Foundation to Java Programming - Nested Loops


Available Answers

  1. 1.

    Fill in the blanks.

    1. The ________ jump statement causes an immediate exit from a function.
    2. The break statement causes an immediate exit from a -__________.
    3. The only exit-controlled loop in java is ________ loop.
    4. The _________ jump statement skip the remaining statements in a loop.
    5. The inner most loop executes _________ in a nested loop.
  2. 2.

    State whether the following statements are True(T) or False(F).

    1. You cannot have a 'while' loop nested in a for loop.
    2. A for loop only within a 'for' loop is called nested loop.
    3. The continue statement causes an immediate exit from a loop.
    4. You can create patterns using a nested loop in Java.
  3. 3.

    With the help of an example, show the working of a nested for loop.

  4. 4.

    What are jump statements? Name the different jump statements available in Java.

  5. 5.

    State one difference between break and continue statement.

  6. 6.

    Give the output of the following program fragment:

    
    int A; 
    for(A=1;A<=10;A++){ 
    System.out.println(A); 
    if(A==4) 
    break; 
    }
    
14 more answer(s) available.

Please login to post your comments.