0
Problem in C
Hi, im a beginner and i have a problem im trying some codes for practice and i dont know where is the problem in this. Can someone help me please? https://code.sololearn.com/cFISvoRnK1ZM/#c
8 Answers
+ 2
Could you link to a Code Playground copy of this, instead of pasting it here?
+ 2
Could you also explain in depth what the issue is? đ It will help save time, and get the issue resolved quicker.
+ 2
When you check if c is equal to "Y", you're using the assignment operator (=). You want to use the "equal to" operator (==). Write this:
if (c == 'Y'){
// insert the rest of the code
}
+ 2
Oh, I didn't see that. đ Good job @DaemonThread!
+ 1
In the if() statement, enter Y in single quotes ( 'Y' ), rather than double ( "Y" ).
0
Thanks i forget put de double equal, but the problem its in when I enter the value "Y" it doesn't enter on if and just go to else why is this?
0
Thanks i already fix that but when i put Y to change the value from "a" it doesnt do the if and go directly to the else
0
Thanks for your help i have help from a firend, he said me to put fflush(stdin); before the scanf(%char,&a);
that fix it