1. ## For not while?

I successfully completed this problem with a while loop, but I was wondering if I could do it with a for loop. Why is the following not working?

Code:
```#include <stdio.h>
#include <stdlib.h>
#define BIL 1000000000

int main(void)
{
float num_one;
float num_two;
int loop_test;
int i;

printf("Give me two numbers:  ");

for(i = scanf("%f%f",&num_one, &num_two); (-BIL<=num_one<=BIL) && (-BIL<=num_two<=BIL); scanf("%f%f",&num_one, &num_two));
{
printf("Here is the (first # - the second #) divided by their product:  %f\n", math_answer);
printf("Give me two more numbers or q to quit:  ");
}

printf("Quitting :)");
return EXIT_SUCCESS;

}```

2. > for(i = scanf("%f%f",&num_one, &num_two); (-BIL<=num_one<=BIL) && (-BIL<=num_two<=BIL); scanf("%f%f",&num_one, &num_two));
1. a <= b <= c does not do what you think it does.
What you end up with is a <= (0 or 1, the boolean result of b <= c)

3. Any while loop can be rewritten as a for loop, and vice versa.

You haven't specified what you mean by "not working". But, clearly, the reason will be that your translation from one loop type to another is flawed.

I'll bet that you have also blown it with testing the condition
Code:
`(-BIL<=num_one<=BIL) && (-BIL<=num_two<=BIL)`
If you expect this to test if num_one is between -BIL and BIL and then test if num_two is between -BIL and BIL.

Instead, it will test -BIL <= num_one (which will give a value of zero or one) first. It will then compare that zero/one is less than BIL (which will always be true). Similarly for num_two. Because of that, you have written an infinite loop (the condition is always true, regardless of input).

The semi-colon at the end of the for() statement will ALSO mean that the following block will never be executed.

4. For your consideration, I don't consider typing scanf() twice in a loop to be neater. The code repetition means that you could change one scanf() one day and not change the other. Most loops can be written this way
Code:
`while ((i = scanf("%f%f", &num_one, &num_two)) == 2)`
Secondly if you want to C-ify a mathematical statement like -BIL<=num_one<=BIL you have to use AND.
Code:
`( -BIL <= num_one && num_one <= BIL ) && ( -BIL <= num_two && num_two <= BIL )`

5. Note the following is probably a mistake:

Code:
```for (i = 0; i < N; i++);
{
foo();
}```
In this code, foo() gets called exactly once, regardless of N. Note the semicolon in this case is a "Null statement" to do nothing inside the for loop.

That, and what the other posters said regarding the familiar math expression LOW < x < HIGH

In C, this becomes: (LOW < x && x < HIGH)

As far as your code, I don't understand what you want to do with BIL. For checking whether the user enters 2 floats, the scanf() function should return 2:

Code:
```    printf("Give me two numbers:  ");
while(scanf(" %f %f",&num_one, &num_two) == 2)
{