Computer Science, asked by rajputamita966, 7 months ago

convert the following segment into equivalent for loop:

int i=10; [5]

while(i<=20){

System.out.print(i+” “);

i++;}​

Answers

Answered by Anonymous
3

Answer:

Convert the following segment into equivalent for loop { int i, 1=0; while (i<=20) System.out.print (i+“”); 1++; }

Top answer · 1 vote

After converting the while loop into for : for(int i=0; i<=20; i++) { System.out.print(i+“

Answered by duragpalsingh
2

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