Advertisements
Advertisements
Question
What message will be displayed, if the input for age is given as 20, for the following snippet?
Advertisements
Solution
if (age> = 18)
{
alert ("you are eligible to get Driving licence"}
}
else
alert ("you are not eligible to get driving licence");
}APPEARS IN
RELATED QUESTIONS
Which conditional statement is used to transfer control from current statement to another statement?
Which of the following is not a branching statement?
In which loop the condition is evaluated, before executing a statement?
The _______ statement is especially useful when testing all the possible results of an expression.
What are the different types of control statement used in JavaScript?
List out the various branching statements in JavaScript?
Write the general syntax for switch statement.
Write the syntax for else-if statement.
Which of the following data type cannot be used with switch case construct?
Rewrite the following code using single if statement.
if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");