YOU WIN Example 4-Please Assig Blackjack r Write a program name Blackjack Ir tha
ID: 3591301 • Letter: Y
Question
YOU WIN Example 4-Please Assig Blackjack r Write a program name Blackjack Ir that allows a human user to play a single hand of "black- jack" against a dealer Pick two values from 1-10 for the player. These are the player's "cards Pick two more values from 1-10 for the dealer Whoever has the highest total is the winner There is no betting, no busting, and no hitting Save that for real blackjack Expected output Blackjack Jn You drew 6 and S Your total is 11 The dealer has 7 and 3. Dealer's total is 10Explanation / Answer
program blackjack_jr.c
this is the program in c language
#include <stdio.h>
main()
{
int i,j,k,l,m,n;
printf("pick Two values for the player between 1 to 10 ");
printf(" enter first value between 1 to 10 ");
scanf("%d",&i);
printf(" enter second value between 1 to 10 ");
scanf("%d",&j);
k=i+j;
printf("your total is %d",k);
printf(" pick Two values for the dealer between 1 to 10 ");
printf(" enter first value between 1 to 10 ");
scanf("%d",&l);
printf(" enter second value between 1 to 10 ");
scanf("%d",&m);
n=l+m;
printf("dealer total is %d",n);
if(k>n)
{
printf(" you win!! ");
}
else
printf(" dealer is the winner ");
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.