next up previous
Next: Level 4 Up: Projects on gcc Intermediate Previous: Level 2


Level 3

Add a simple branch - if-then-else, a for and while loop to the language at Level 2. The basic control constructs for branching and loop - finite and infinite - should now enable us to write more effective programs.

Some examples of source programs are:

  1.   int i;
      int n;
      int factorial;
    
      if (n == 0)
        factorial = 1;
      else
        for (i = 1; i < n; i = i + 1)
          factorial = factorial * i;
    



2006-01-08