Page 93 - TP_iPlus_V2.1_Class8
P. 93
3. The ........................ keyword is used to define the case in the switch statement.
4. The ........................ keyword is used to stop the execution of the switch statement when a matched
case is found.
5. A ........................ statement allows us to change the default flow of a program.
C. Write ‘T’ for true and ‘F’ for false.
1. The while statement is a conditional statement in Java. ......................
2. The do-while loop is similar to the for loop. ......................
3. The variable that controls the execution of a loop is known as a
control variable. ......................
4. The break statement forcefully terminates the loop within which it lies. ......................
5. The default must be the first case in the switch statement. ......................
Section B (Subjective)
A. Short answer type questions:
1. What is a looping statement in Java?
2. What is the use of the if statement in Java?
3. What is the use of the default keyword in the switch statement?
4. What is a syntax error?
B. Long answer type questions:
1. What is the for loop in Java? Write its syntax.
2. What is the difference between break and continue statements?
3. What are jump statements? Write the names of two jump statements.
4. What is the difference between a syntax error and a logical error?
C. What will be the output of the following Java codes?
1. public static void main(String args[]) Write output here:
{
int num=1, square = 0;
while(num <= 10)
{
square = num * num;
System.out.println("Square of "+num+" is: "+square);
num++;
}
}
91
Conditional, Looping and Jump Statements in Java

