 Java All : Basic Loop Types Exam Papers Problems #### Infinite Loop #3920

( As In Exam - ICSE2014 )

What is an infinite loop? Write an infinite loop statement.

What is an infinite loop? Write an infinite loop statement.

#### while do-while comparison #4042

( As In Exam - ICSE2018 )

State the difference between while and do while

State the difference between while and do while loop.

#### for loop output #4071

( As In Exam - ICSE2018 )

Give the output of the following program segment and also mention how many t

Give the output of the following program segment and also mention how many times the loop is executed:
int i;
for (i=5;i>10;i++)
System.out.println(i);
System.out.println(i*4);

#### while to for conversion #4246

( As In Exam - ICSE2016 )

Convert the following while loop to the corresponding for loop :

int m

Convert the following while loop to the corresponding for loop :

int m = 5, n = 10;
while (n>=1)
{
System.out.println(m*n);
n- -;
}

#### for loop output and execution count #4252

( As In Exam - ICSE2016 )

Analyze the given program segment and answer the following questions :

Analyze the given program segment and answer the following questions :
(i) Write the output of the program segment
(ii) How many times does the body of the loop gets executed?
for(int m=5; m<=20; m+=5)
{
if(m%3 == 0)
break;
else
if(m%5 == 0)
System.out.println(m);
continue;
}

#### do loop based output writing #4275

( As In Exam - ICSE2015 )

Write the output of the following code segment:

```char ch;
int x = 97

```

Write the output of the following code segment:

```char ch;
int x = 97;
do {
ch = (char) x;
System.out.print(ch + " ");
if (x % 10 == 0)
break;
++x;
} while (x <= 100);```

Exam Paper Problems:6
×