ICSE Class 10 Computer Applications Question 23 of 30

Solved 2023 Question Paper ICSE Class 10 Computer Applications — Question 23

Back to all questions
23
Question

Question 2(iii)

Convert the following do…while loop to for loop:

int x = 10;
do
{
x––;
System.out.print(x);
}while (x>=1);	
Answer
for(int x = 9; x >= 0; x--)
{
    System.out.print(x);
}