+ 1
About Sololearn empty input in C
Pressing the "submit" button without any input gives a new line character as the result, but entering a "new line character" (pressing enter on an android keyboard) and then tapping on the "submit" button gives a "new line character", the same result. Two different inputs, but the result is the same. Am I missing something? Any logical reason why this is happening? https://code.sololearn.com/cqRw2Yk75Jkx/?ref=app
1 Answer
0
Hi, saw your question, as per my concern, you must add a ELSE statement that prints the values of C.
EOF : ASCII VALUE : 13
\n : ASCII VALUE : 10
First of all, Pressing the Submit button without any input will take '\n' & EOF as default and will print NEW LINE and the while loop terminates.
Secondly, entering the '\n' character and ENTER (EOF) key will take '\', 'n', '\n' & ENTER characters and will print NEW LINE and the while loop terminates.
I hope this helps maybe, you can get more info by observing the values of C printed.