Well, this is the end of Chapter 1 of the tutorial - and it's only taken me three weeks to write it. Here's a summary of what you really ought to know by now:
int x; float height; char index_letter; int a,b,c; float mm, age;
my_try = 3;
float step_value = 3.01;
30 - 6 * 2 produces the value 18
(30 - 6) * 2 produces the value 48
(2 * (3 + 4) - 7) % 2
== |
Equal to |
!= |
Not equal to |
> |
Greater than |
< |
Less than |
>= |
Greater than or equal to (i.e. not less than) |
<= |
Less than or equal to (i.e. not greater than) |
for ( <initialisation>; <terminating condition>; <increment> )
{ one statement or block of statements }
The the initialisation section tells the program what variable(s) to set up at the start of the loop. The the terminating condition is the condition which determines when the loop stops (the loop runs until the condition fails) and the the increment part indicates what the program is supposed to do at the end of each section - normally increasing or decreasing a counter value for the loop.
while ( <condition> )
{ one statement or a block of statements }
The loop continues all the time that the condition is true. If the condition fails the first time round, the loop never executes.
do
{ one statement or a block of statements }
while ( <condition> );
The loop continues all the time that the condition is true, but, unlike the while loop, the condition is tested at the end of each time round the loop. The statement(s) inside the loop are always executed at least once, as they have already been carried out when the condition is tested for the first time.
Crumbs, you have learned a lot, haven't you!