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
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
संबंधित प्रश्न
Which conditional statement is used to transfer control from current statement to another statement?
In which loop the condition is evaluated, before executing a statement?
<script type=“text/javascript”>
x = 6 + “3”;
document.write(x);
</script>
what will be the output?
Differentiate the break and continue statement.
What is if statement and write its types.
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?
The absence of which statement leads to fall through situation in switch case 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");