// aug4ex1a.cpp : Defines the entry point for the console application.
// prints 52 cards in order

#include "stdafx.h"

void print_card(int);

int main(int argc, char* argv[])
{   int kard;

for (kard=1; kard <= 52; kard++)  {
	print_card(kard);
	printf("\n");
}


	return 0;
}


// this function prints out a card given a num 1 - 52
void print_card (int card)  {
	int suit, rank;
     
	rank = (card-1) % 13 + 1;
	suit =  (card-1) / 13 + 1;

	switch (rank) {
	 case 1: printf("Ace of "); break;
     case 11: printf("Jack of "); break;
     case 12: printf("Queen of "); break;
	 case 13: printf("King of "); break;
     default: printf("%d of ", rank); break;
	} /* end switch rank */

    switch(suit) {

	case 1: printf("Hearts ");break;
	case 2: printf("Clubs "); break;
	case 3: printf("Diamonds "); break;
	case 4: printf("Spades "); break;
	} /* end switch suit */

} /* end function print_card */