Computer Applications
What is meant by 'conditional' statement? Explain.
Java Conditional Stmts
53 Likes
Answer
The order in which the statements of a program are executed is known as control flow. By default, the statements of a program are executed from top to bottom in order in which they are written. But most of the times our programs require to alter this top to bottom control flow based on some condition. The statements that help us to alter the control flow of the program are known as conditional statements.
Answered By
33 Likes
Related Questions
switch case construct into if-else-if :
switch (n) { case 1: s=a+b; System.out.println("Sum="+s); break; case 2: d=a-b; System.out.println("Difference="+d); break: case 3: p=a*b; System.out.println("Product="+p); break; default: System.out.println("Wrong Choice!"); }
if-else-if construct into switch case:
if(var==1) System.out.println("Distinction"); else if(var==2) System.out.println("First Division"); else if(var==3) System.out.println("Second Division"); else System.out.println("invalid");
What is the significance of System.exit(0)?
Is it necessary to include default case in a switch statement? Justify.