Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need a flow chart for this code in c Please give me a correct answer not on a software that generate it #include #include

i need a flow chart for this code in c Please give me a correct answer not on a software that generate it

#include #include

void startGuessTheNumberGame(); // define function

int main() { startGuessTheNumberGame(); } void startGuessTheNumberGame() // define function { int secretNumber ; int low = 1 ; int high = 10000 ; int menu2 ; int counter = 1 ; int Guess ; printf("Enter A Secret Number Between 1 and 10000 : "); scanf("%d", &secretNumber);

while(low <= high) { Guess = low + (high - low) / 2; printf(" My Guess is : %d", Guess) ; printf(" Please Choose One Of The Following 3 Options : 1.My Guess Is Correct. 2.The secret Number IS Larger Than %d", Guess) ; // print menu printf(". 3.2.The secret Number IS Smaller Than %d", Guess);

printf(" "); scanf("%d",&menu2); switch(menu2) { case 1 : printf("we take to find their secret number %d", counter); break;

case 2 : low = Guess + 1 ; break; case 3 : high = Guess - 1; break;

default : printf("your Choose is Invalid "); break ; }

if(menu2 == 1) // to exit the program { break ; // Exit the program } counter++;

} }

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_2

Step: 3

blur-text-image_3

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago