Greetings,
I'm having a problem with this code below. I want to ask 3 questions and then gather userinput into char variables. When I run the program it asks the first question and then outputs the answer. Then it asks the second question, but does not allow the user to answer the question and moves on to the last question which it does allow user input. Is there a rule about the use of multiple scanf's? Here's a screen shot:
[IMG]file:///C:/DOCUME%7E1/smr10/LOCALS%7E1/Temp/moz-screenshot.jpg[/IMG][IMG]file:///C:/DOCUME%7E1/smr10/LOCALS%7E1/Temp/moz-screenshot-1.jpg[/IMG]
#include <stdio.h>
#include <stdlib.h>
int main()
{
char Light;
char lane;
char turn;
char PlayAgain = 'Y';
//while(PlayAgain == 'y')
{
//USER_INPUT Light Red?, Lane Right? Turn Yes?;
printf("Is light red? ");
scanf("%c", &Light);
printf("%c", Light); //validate user input
printf("Are you in the right lane? ");
scanf("%c", &lane);
printf("%c", lane); //validate user input
printf("Are you making a turn? ");
scanf("%c", &turn);
printf("%c", turn); //validate user input
}