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

Write the equivalent code, using a while loop for the following code. for (j = 0; j < 20; j = j + 1) printf("j is %d\n", j);

OpenStudy (anonymous):

int j = 0; while(j<20){ printf("j is %d\n",j); j++; }

OpenStudy (anonymous):

In general, a for loop has: ``` for (initial_statement; condition; step_statement) { loop_statements; } ``` This can be reorganized into ``` initial_statement; while (condition) { loop_statements; step_statement; } ```

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!