Home / Expert Answers / Computer Science / 5-what-is-the-output-of-the-following-code-int-mathrm-x-5-while-x-pa808

(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 \( (\math
\( 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 \)


We have an Answer from Expert

View Expert Answer

Expert Answer


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
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe