teknoraver icon

switch

teknoraver | PRO | 07/12/21 11:46:02 PM UTC | 0 ⭐ | 2232 👁️ | Never ⏰ | []
C |

340 B

|

None

|

0 👍

/

0 👎

#include <stdio.h>
#include <stdlib.h>
 
int main(int argc, char *argv[])
{
    int i = atoi(argv[1]);
    int j = atoi(argv[2]);
 
    switch (i) {
    case 1:
    case 2: if (j % 3 == 0) {
    case 3:   puts("j % 3");
    case 4: } else if (j % 2 == 0) {
    case 5:   puts("j % 2");
    case 6: } else {
    case 7:   puts("none");
    case 8: }
    }
 
    return 0;
}
 

Comments