Math, asked by shraddha0608200488, 11 months ago


5. Convert the following segment into equivalent for loop:
int i = 0;
while(i <= 20) {
System.out.print (i + " ");
i++;
}​

Answers

Answered by duragpalsingh
6

Question:

Convert the following segment into equivalent for loop:

int i = 0;

while(i <= 20) {

System.out.print (i + " ");

i++;

}​

Solution:

int i;

for(i=0;i<=20;i++)

{

System.out.print(i+" ");

}

Similar questions