Advertisements
Advertisements
प्रश्न
Rewrite the following code using the if-else statement:
int m = 400;
double cl). = (m>300) ? (m/10.0) * 2; (m/20.0) - 2;संक्षेप में उत्तर
Advertisements
उत्तर
int m = 400;
double ch;
if (m>300)
ch = (m/10.0)*2;
else
ch = (m/20.0) - 2;shaalaa.com
Introduction of Conditional Statements in Java
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
APPEARS IN
संबंधित प्रश्न
Which statement in switch case is used to exit the statement once the appropriate choice is found?
What will be the output for the following snippet:
For (var n=0; n<10; n++)
{
if (n==3)
{
break;
}
document write (n+”<br>”);
}The _______ statement is especially useful when testing all the possible results of an expression.
Write the general syntax for switch statement.
Write the syntax for else-if statement.
What message will be displayed, if the input for age is given as 20, for the following snippet?
Explain switch case statement with example.
The absence of which statement leads to fall through situation in switch case statement?
Give the output of the following program segment:
int n = 4279; int d;
while(n>0)
(d=n%10;
System.out.println(d);
n=n/100;
}Which of the following is not true with regards to a switch statement?
