190k views
0 votes
Rewrite the following program segment using a while loop instead of a for loop.

for(i=0;i<100;i++){
if (i%2===0){
print (i)
}
}​

User NonDucor
by
3.7k points

1 Answer

2 votes

Answer:

while i=0 or i<100:

if (i%2==0):

print(i)

User Lord Windy
by
4.0k points