I'm trying to make a deck of cards using c programming. I want it so the computer will ask me for a number from 1-52 and each of the numbers will correspond to a card. I've got as far as the program printing every card but I have no idea how to make a card "whole". I have all the numbers and all the suits but they are in no way attached, they just print up at together. Can anyone help please.
Code:
#include <stdio.h>
int main(void) {
char value[14][6]={"Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Jack","Queen","King","Ace"};
char suit[4][9]= {"Hearts", "Diamonds", "Clubs", "Spades"};
int i=0;
int j=0;
for (i=0; i<13; i++){
for (j=0; j<4; j++){
printf("The %s of %s\n\n", value[i], suit[j]);
}
}
system("pause");
}
All this does is print each number 4 times and cycles through the suits.
Also I'm relatively new to c programming so if possible could the programming be kept at a level easy to understand.
Thanks!