<mosaic.cnfolio.com>
PROGRAM
  1. #include <stdio.h>
  2. // define variables
  3. // ask for amount of cards
  4. // ask for which cards
  5. // show cards given
  6. // repeat for player two
  7. // get largest card from both arrays
  8. //compare them both
  9. //output appropriate reaction
  10.  
  11.  
  12. int main()
  13. {
  14.     int array[10], array2[10], n2, c2, n, c, i, largest, largest2; //defining
  15.  
  16.     printf("Player 1 enter how many cards you want\n");   //getting array size
  17.     scanf("%d", &n);
  18.  
  19.     printf("Enter %d cards\n", n)//filling array
  20.  
  21.     for ( c = 0 ; c < n ; c++ )
  22.         scanf("%d", &array[c]);
  23.  
  24.     printf("Your cards are:\n")//showing array (hand)
  25.  
  26.     for ( c = 0 ; c < n ; c++ )
  27.         printf("card[%d] = %d\n", c, array[c]);
  28.        
  29.     printf("Player 2 enter how many cards you want\n"); //repeating for player 2
  30.     scanf("%d", &n2);
  31.  
  32.     printf("Enter %d cards\n", n2);
  33.    
  34.     for ( c2 = 0 ; c2 < n2 ; c2++ )
  35.         scanf("%d", &array2[c2]);
  36.    
  37.     largest = array[0];                                       //working out largest number from player 1s array
  38.      for (i = 1; i < n; i++)
  39.    
  40.         if (largest < array[i])
  41.             largest = array[i]
  42.     printf("\n player 1s largest card is: %d", largest);
  43.    
  44.     largest2 = array2[0];
  45.      for (i = 1; i < n2; i++)
  46.    
  47.         if (largest2 < array2[i])                          //doing the same for player 2
  48.             largest2 = array2[i]
  49.     printf("\n player 2s largest card is: %d", largest2);
  50.    
  51.    
  52.    
  53.     return 0;
  54. }