(Solved): \( 5 . \) What is the output of the following code? int \( \mathrm{X}=5 \); while \( (X ...
\( 5 . \) What is the output of the following code? int \( \mathrm{X}=5 \); while \( (X<=20) \) \{ System.out.print \( (\mathrm{X}+ \) "c \( ) \); \( \mathbf{X}=\mathrm{X}+5 \)
Answer : int x = 5; while(x<=20){ System.out.print(x + " "); x = x+5; } In the above code, a variable x is defined and its value is initialised as 5. A while loop used here, so while loop first checks the condition , and if it is true, th