So if my input is 10 and 2
my output should be 2 4 6 8.
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 :
Expand|Select|Wrap|Line Numbers
- if(num1 < 0 || num1==NULL){
- printf("enter a number greater than 0");
- return 0;
- }
Is there a solution to this? assuming that you only know arrays, pointers, and conditions, and the only lib you know of is stdio.