Advertisement
Lisaveta777

Weird continue (in switch in while)

Sep 1st, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char card_name[3];
  6.  
  7.     while(card_name[0]!='q')
  8.     {
  9.         scanf("%2s",card_name);
  10.  
  11.         switch(card_name[0])
  12.         {
  13.         case 'n':
  14.            break;//dont skip printf,ok
  15.         case 'y':
  16.             continue;//skips printf ???
  17.         case 'q':
  18.             break;//dont skip printf,ok
  19.         }
  20.         printf("no skipping printf for %c\n",card_name[0]);
  21.     }
  22.  
  23.  
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement