Advertisement
teknoraver

switch

Jul 12th, 2021
1,415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.     int i = atoi(argv[1]);
  7.     int j = atoi(argv[2]);
  8.  
  9.     switch (i) {
  10.     case 1:
  11.     case 2: if (j % 3 == 0) {
  12.     case 3:   puts("j % 3");
  13.     case 4: } else if (j % 2 == 0) {
  14.     case 5:   puts("j % 2");
  15.     case 6: } else {
  16.     case 7:   puts("none");
  17.     case 8: }
  18.     }
  19.  
  20.     return 0;
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement