+ 3
Why does it trigger twice when ive only inputed 2, 3 and Y? (Relatively new to c again)
2 odpowiedzi
+ 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.