Code:
#include <stdio.h>
int main( void )
{
char inputtedhand[25];
int index;
int text;
int tempvar;
char tempsuit;
int cardvalue, card1value, card2value, card3value, card4value, card5value;
char cardsuit, card1suit, card2suit, card3suit, card4suit, card5suit;
int card1text, card2text, card3text, card4text, card5text;
int i,m;
for( index==0; index<=5; index++)
{for(i==0; i<=15; i+=3)
{
scanf( "%d", &inputtedhand[i]);
if (inputtedhand[i]=2)
{
text= ("The two of");
tempvar=2;
}
else if (inputtedhand[i]=3)
{
text= ("the three of");
tempvar=3;
}
else if (inputtedhand[i]=4)
{
text= ("the four of");
tempvar=4;
}
else if (inputtedhand[i]=5)
{
text= ("the five of");
tempvar=5;
}
else if (inputtedhand[i]=6)
{
text= ("The six of");
tempvar=6;
}
else if (inputtedhand[i]=7)
{
text= ("The seven of");
tempvar=7;
}
else if (inputtedhand[i]=8)
{
text= ("The eight of");
tempvar=8;
}
else if (inputtedhand[i]=9)
{
text= ("The nine of");
tempvar=9;
}
else if (inputtedhand[i]=0)
{
text= ("The ten of");
tempvar=10;
}
else if (inputtedhand[i]="J")
{
text= ("the jack of");
tempvar=11;
}
else if (inputtedhand[i]="Q")
{
text= ("the queen of");
tempvar=12;
}
else if (inputtedhand[i]="K")
{
text= ("the kign of");
tempvar=13;
}
else if (inputtedhand[i]="A")
{
text= ("the ace of");
tempvar=14;
}
m=(i+1);
scanf("&d", &inputtedhand[m]);
{
if (inputtedhand[i]="C")
{
text=text+" Clubs";
}
else if (inputtedhand[m]="D")
{
text=text+" Diamonds";
}
else if (inputtedhand[m]="H")
{
text=text+" Hearts";
}
else if (inputtedhand[m]="S")
{
text=text+" Spades";
}
}
{
if (index=1)
{
tempvar=card1value;
tempsuit=card1suit;
text=card1text;
}
else if (index=2)
{
tempvar=card2value;
tempsuit=card2suit;
text=card2text;
}
else if (index=3)
{
tempvar=card3value;
tempsuit=card3suit;
text=card3text;
}
else if (index=4)
{
tempvar=card4value;
tempsuit=card4suit;
text=card4text;
}
else if (index=5)
{
tempvar=card5value;
tempsuit=card5suit;
text=card4text;
}
}
} /* i loop*/
} /* index loop */
{
/* displays the inputted hand example "The first card is the 2 of heart"*/
scanf("%s", &card1text);
printf("the first card is %c", card1text);
scanf("%s", &card2text);
printf("the second card is %c", card2text);
scanf("%s", &card3text);
printf("the third card is %c", card3text);
scanf("%s", &card1text);
printf("the forth card is %c", card4text);
scanf("%s", &card1text);
printf("the fifth card is %c", card5text);
}
}