Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

user rolls 3 dice and print out their total (dice a +dice b and + dice c) and after it get the sum the user

user rolls 3 dice and print out their total (dice a +dice b and + dice c) and after it get the sum the user looks at it and then guesses if the next roll is going to be higher ;if it is they will press h and press enter l if it is lower and s if it is the same press enter roll again and if the is guess right print out good job if wrong you suck

My code is not giving the output for case l and case s.WHY is it wrong? image text in transcribed

x OX ace Build Debugger Plugins Perspective Settings PHP Help X Lab5a.c main.c Labi.c *mainc #include #include v int main() { int dicel,dice2,dice3, suml, sum2; char guess; dicel=(rand()*6+1); dice2=(rand()$6+1); dice3=(rand()*6+1); suml=dicel+dice2+dice3; printf("The sum of three dices: %d ", suml); printf("Guess whether next sum is same ,higher or lower(s/h/l): "); scanf("%c",&guess); dicel=(rand()$6)+1; dice2=(rand()$6)+1; dice3=(rand()$6)+1; sum2=dicel+dice2+dice3; switch (guess) { case 'h': if (suml>sum2) { printf("U WON "); if(suml

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions