Some thing that I've been wondering about for a while, is the precedence of < (less than) and <= (less than or equal). As far as I know, these operators have the same precedence.
Now, take this for an example:
Would print 0, 1, 2, 3. However, if I change it so:Code:int i; for (i = 0; i < 4; i++) { printf ("%d\n", i); }
It prints 0, 1, 2, 3, 4. So what's the deal? In the second code snippet, it loops while i is less than or equal to four. In the first example, it loops while is less than four. Can someone explain to me why this behaviour - i.e. the second example should (in theory) yield the same results as the first example, right?Code:int i; for (i = 0; i <= 4; i++) { printf ("%d\n", i); }