int32_t number;
uint32_t x = 1;
puts("What number do you want to count: ?");
{
scanf("%i", &number);
printf("You typed%i.\n", number);
while(x < number) {
printf("%i and then \n", x);
x++;
}
if (x > 100 || x < 1)
printf("error");
}
I want to print all the numbers till the user inputs numbers. But if the inputted number is less than 1 or greater than 100 then it should say error and ask the user to input the number again but it does not do that. for instance if the number is 455 it should say error and prompt the user to input the number again.The program above only prints error after printing all the numbers even number grater or less than 100 and 1 respectively.