Print Cards

  1. Playing cards have four suits:
  2. There are 13 ranks in a suit:
  3. Let us use an integer between 0 and 51 to represent 52 cards:
       	      2  3  4  5  6  7  8  9  T  J  Q  K  A
    	     ======================================
       Club       0  1  2  3  4  5  6  7  8  9 10 11 12
       Diamond   13 14 15 16 17 18 19 20 21 22 23 24 25
       Heart     26 27 28 29 30 31 32 33 34 35 36 37 38
       Spade     39 40 41 42 43 44 45 46 47 48 49 50 51
       
  4. Design a function print_card(int i) to display a card corresponding to the integer value. For example,
  5. Test your function with the folloing main program
    
    int main()
    {
        int i;
        int my_card[5];
        srand( time(NULL) );
        for (i=0; i<5; i++)         // Get_Five
            my_card[i] = rand() % 52;
        
    
        for (i=0; i<5; i++)
        {
            print_card(my_card[i]);
            cout << (i==4 ? '\n' : ' ');
        }
        return 0;
    }