Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // apple xcode
- // paulogp
- /* break and continue */
- /* like the break keyword, the continue keyword is used to affect
- how a loop loops. this time, the job is to immediately repeat the
- loop, skipping over the remaining statements and starting the loop
- over with the first line (the for, while, or do or whatever started
- the loop in the first place) */
- #include <stdio.h>
- int main (int argc, const char * argv[])
- {
- int the_n = 0;
- for (;;) // infinite loop
- {
- the_n++;
- if (the_n <= 5)
- {
- printf("%d, ", the_n);
- continue;
- }
- printf("%d e maior que 5!\n", the_n);
- break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement