This scanf should always return true until I input none numeric input, but this scanf never executes while loop. Why?
Sample input:
10.0 5.0
Press [Enter] to close the terminal ...
Code:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
float a, b;
while ( scanf("%f %f", &a, &b) == 1 )
{
printf("%f\n", (a - b) / (a * b));
}
return (EXIT_SUCCESS);
}