Hi.I have this problem : I am entering numbers to float ... I want program to find out, which first number is not from specific interval. How to do it ? Example: Enter input : 5 10 20 30 50 46 . 30 is invalid. Here is the code :
Code:
while(scanf("%f",&input)!=EOF || input==0)
{
sum=input+sum;
if (getchar() == '\n') break;
}; //user input ended with enter/0
if(input!=100 ||input!=50 ||input!=20 ||input!=10 ||input!=5 ||input!=2 ||input!=1 ||input!=0.5 ||input!=0.2 ||input!=0.1 ||input!=0.05 ||input!=0.02 ||input!=0.01)
printf("%f is invalid\n",input);
Any help appreciated