Generating a deck of cards in C -
i need assignment. supposed generate , print 52 cards, i'm having trouble understanding how print "ace", "2".....etc. for(i=0; < 52; i++) { if(i%13==0) { printf("card %2d = king %s\n", i,suits[i/13]); } else if(i%13==1) { printf("card %2d = ace %s\n", i,suits[i/13]); } else if(i%13==11) { printf("card %2d = jack %s\n", i,suits[i/13]); } else if(i%13==12) { printf("card %2d = queen %s\n", i,suits[i/13]); } else { printf("card %2d = %2d %s\n", i, i%13, suits[i/13]); } } another solution adding more condition loop "king" "ace" "jack" , "queen"