Computer Science, asked by amishaanand875, 10 months ago

Give the output :
int a=3;
while(a<=10)
{
a++;
if(a==5)
continue;
System.out.println(a);
}

Answers

Answered by sudhanshu1834cse18
0

Answer:5

Explanation:

firstly check the while condition,if while condition is true then program will be executed otherwise it will be out to the loop

Answered by AskewTronics
1

Below are the output for the above code:

Explanation:

4

6

7

8

9

10

11

Detailed Explantion:

  • The above output will be displayed when the question code will be executed when the user writes the code in the main function.
  • It is because the above loop will execute for a value that lies from 3 to 10.
  • Then the first line increases the a value by 1, which makes the starting a value is 4.
  • then the if-condition will check the a value to be 5, if the value of a is 5 then it will not render as output but all the value from 4 to 10 (except 5) will be printed as output.
  • The 5 will not be printed because they continue the statement continues the loop escaping the rest statement of the loop if the if statement will true. It is because of the if statement holds the continue statement.

Learn More:

  • C-program : https://brainly.in/question/637147
Similar questions