About Sololearn empty input in C | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

26th Nov 2022, 5:22 PM
Lofty
Lofty - avatar
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.
8th Dec 2022, 9:13 PM
Prashant Narendra Solanki
Prashant Narendra Solanki - avatar