i'm sorry.
Code:
/*Function to Deal a card*/
char DealCard (nDCard)
{ char cCard;
nDCard=rand()%13+1;
switch (nDCard)
{ case 1: printf ("Ace of");
break;
case 2: printf ("Two of");
break;
case 3: printf ("Three of");
break;
case 4: printf ("Four of");
break;
case 5: printf ("Five of");
break;
case 6: printf ("Six of");
break;
case 7: printf ("Seven of");
break;
case 8: printf ("Eight of");
break;
case 9: printf ("Nine of");
break;
case 10: printf ("Ten of");
break;
case 11: printf ("Jack of");
break;
case 12: printf ("Queen of");
break;
case 13: printf ("King of");
break;
}
return (cCard);
}
Code:
/*Function to determine card suit*/
char Suit (nSuit)
{ char cSuit;
nSuit=rand()%4+1;
switch (nSuit)
{ case 1: printf (" Hearts"); break;
case 2: printf (" Diamonds"); break;
case 3: printf (" Spades"); break;
case 4: printf (" Clubs"); break;
}
return (cSuit);
}
Code:
cCard=DealCard();
cSuit=Suit();
printf ("\n");
printf ("%c", cCard);
printf ("%c", cSuit);
DealCard();
Suit();
/*expected output, assuming the value random generated is Three of Hearts*/
Three of Hearts
Three of Hearts
Four of Spades
Code:
/*what happens is this, assuming the same value is generated*/
Three of Hearts
Four of Spades
i'm sorry again. pls help me and thanx a lot