I have a question, We were asked by our teacher to write a rock paper scissors program using the if else statement
my problem is
if i code it like this
char a, b;
clrscr();
printf("\n Enter player 1 value");
scanf("%c", &a);
printf("\n Enter Player 2 value:);
scanf("%c", &b);
my problem is when i code it like this after entering the 1st value it ignores the second one and just goes on the if statements
and i found a solution which is putting space on %c on the second scanf which looks like this (found a similar program)
scanf(" %c", &b);
and it works but now i don't know why ?? can anyone explain to me why it was being ignored and why putting a space solves that problem ?? it will gladly help
thanks in advance