How do I determine if a value is within a range?
问题 I am relatively new to C, I have to do it for school unfortunately and I am having issues with it at the easiest exercises. Here I have to check if a number is in a certain interval, for example between 4 and 6. I made it like this. #include <stdio.h> int main(){ int i; printf("Value to check Interval \n"); scanf("%s", i); if (i>4 && i<6){ printf("%s Value is in first interval\n", i); } } The scanf to enter the number and check if it is in the interval. But even if I enter a number that is