I'm trying to check if a number is an integer (num).
In the main() -
int num, input;
printf("Please enter an integer greater than 1:\n");
input = scanf("%d",&num);
if ( input != 1 ){
printf("Invalid input!\n");
return 1;
}
but when the input is not an integer (33.3 for example), the value of "input" is still 1.
printf("%d ", input);
gives me back 1.
The rest of the program works. Just got stuck on this minor thing.