#beginner question in c

8 messages · Page 1 of 1 (latest)

snow flameBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

light isle
#

put your scanf into the while loop, and initialize the variables with zero so its not filled with wrong numbers

zealous nest
#

Would need to get a line as string and attempt sscanf on that.

light isle
#

also ig thats the wrong channel its C code #1013104018739974194

zealous nest
#

The function will return the number of inputs it successfully read, and you can check to only proceed if it reports 2.

zealous nest
#

About why just scanf doesn't work, it's because if only one number is entered, the terminal will wait for the second one.