+ 3
Why does it trigger twice when ive only inputed 2, 3 and Y? (Relatively new to c again)
https://code.sololearn.com/c3mKD1uY7vCl/?ref=app
2 Answers
+ 1
If input is 2 3 y
Then After input to a, b by 2 3 a space is read by scanf("%c", &try) ; so now try has value as space charecter. So it is not equal to y or Y. And again until input console see the next required input of Integer for a, it won't read value and retain its privoius values..
Test by this input 2 3y
Or put statement getchar() before scanf for consume space after 3 input..
0
Thanks a lot for your help.
Hot today
What is the problem ๐คจ๐ง??
1 Votes
Generador de divicion python.
1 Votes
Broken Image in Sololearn App
0 Votes