Question: This is in c. Why do we scanf twice first outside loop and then in a loop? When i take out the while loop it

 This is in c. Why do we scanf twice first outside

This is in c. Why do we scanf twice first outside loop and then in a loop? When i take out the while loop it crashes. Why is that?

*ASK USER FOR INITIAL STATE*/ char state: initial state: scanf ( "%c" ,&state) while(staten') scanf ( "%" , &state)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!