5. Convert the following segment into equivalent for loop:
int i = 0;
while(i <= 20) {
System.out.print (i + " ");
i++;
}
Answers
Answered by
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