Ask your own question, for FREE!
Mathematics 17 Online
OpenStudy (anonymous):

What does the following code do? #include int main(void) { int i, j, k; for (i = 0; i < 10; ++i) { for (j = 0; j < 10; ++j) { for (k = 0; k < 10; ++k) { printf("%d%d%d\n", i, j, k); } } } return 0; }

OpenStudy (anonymous):

It prints a table of values, where the values could be represented in a 3-dimensional table

OpenStudy (anonymous):

It generates numbers between 100 and 199.

OpenStudy (anonymous):

100 and 999

OpenStudy (anonymous):

Sorry. Yes! Mistyped. :-)

OpenStudy (anonymous):

http://ideone.com/uRi0l

OpenStudy (anonymous):

000 and 999 :-D

OpenStudy (anonymous):

hmm yeah I was thinking about because it is ++i not i++

OpenStudy (anonymous):

Yes....same here. Increment happens before the test I thought in the way it was written. God it has been 12 years since I coded. So, I may be wrong.

OpenStudy (anonymous):

hmm good point I made it a habit to write ++i instead of i++ in my loops, but I never figured it would make a difference in the final part of a for-loop. Let me see what happens if I make it post-increment http://ideone.com/y7htD No change :(

OpenStudy (anonymous):

Interesting. I always wrote it as i++ back in the days.

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!