ECE 1620 - Assignment #7 p2 Extra - Due: 25 March 2022


a7/p2.c - blackjack dealing & checking

After shuffling and displaying the array, display the cards again two at a time, using the letters 'A', 'J', 'Q', 'K' for the values 1, 11, 12, 13. Also display the sum of the two cards, counting ace as 11 and jack, queen, king as 10. If the sum equals 21, print "Blackjack!".

Example output:

  9  J  =  19
  K  9  =  19
  K  A  =  21  Blackjack!
  J  7  =  17
  3  Q  =  13
  6  3  =   9
  8  9  =  17
  3  2  =   5
  K  A  =  21  Blackjack!
  K  5  =  15
  7  3  =  10
  4  8  =  12
  7  Q  =  17
  A  2  =  13
 10  8  =  18
  5  4  =   9
  5 10  =  15
  A 10  =  21  Blackjack!
  6  8  =  14
  J  6  =  16
  7  J  =  17
  5  4  =   9
  4 10  =  14
  2  Q  =  12
  6  9  =  15
  2  Q  =  12