Advertisements
Advertisements
प्रश्न
Rewrite the following code using single if statement.
if(code=='g')
System.out.println("GREEN");
else if(code=='G')
System.out.println("GREEN");एका वाक्यात उत्तर
Advertisements
उत्तर
if(code=='g' || code=='G')
System.out.println("GREEN");shaalaa.com
Introduction of Conditional Statements in Java
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
APPEARS IN
संबंधित प्रश्न
Which of the following is not a branching statement?
In which loop the condition is evaluated, before executing a statement?
What are the different types of control statement used in JavaScript?
What is meant by conditional statements in JavaScript?
List out the various branching statements in JavaScript?
Differentiate the break and continue statement.
What is if statement and write its types.
Write the syntax for else-if statement.
Which of the following data type cannot be used with switch case construct?
A student executes the following program segment and gets an error. Identify the statement which has an error, correct the same to get the output as WIN.
boolean x=true;
switch(x)
{ case 1:System.out.println("WIN");break;
case 2;System.out.println("LOOSE");
}