C validating input char dating tip s
the problem now is that if i type in negative value or a character i won't get a correct output.so i came up with this validation : which is not efficient at all.
So if my input is 10 and 2 my output should be 2 4 6 8.cause instead of re-prompting for another input of num1, it just exits. assuming that you only know arrays, pointers, and conditions, and the only lib you know of is stdio.and if it is NULL a different message should be printed. Basically i have this task to get 2 inputs stored into num1 and num2 of int type.The following 'book example' of validating input seems to be incomplete.Since it is a beginner's book it may be intentional for simplicity.