Ask your own question, for FREE!
Computer Science 27 Online
OpenStudy (anonymous):

How many iterations for the following loop: for (int i=1; i< =10; i=i+2) {

OpenStudy (anonymous):

I think it's 6 but I wanna make sure.

OpenStudy (rsmith6559):

5

OpenStudy (anonymous):

Well i starts at 1 which is less than 10 so it executes. Then at 3,5,7 and 9. Next is 11 which is not <= 10 so it does not. So 5

OpenStudy (anonymous):

Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!