Example Eleven

This programme has many errors in it! Fix them --- see the comments in it.
  /* This programme is supposed to declare two integers and an integer
     array, then initialise the array, then print the two integers and
     each element of the array. */

  /* There are many errors in this programme:  
     it doesn't do all of the above and it won't compile.
   */

  #include <stdio.h>

  main() {
      int k = 3000, a[10], j = 4000;

      for(i = 1; 1 <= 10; i++)
          a(i) := i;

      for (i = 1; i <= 10; i++)
          printf("%d /n", a[i]);

      printf("%d /n", j);
    }


...cont'snext...



About this document:

Produced from the SGML: /home/isd/public_html/_course_crash_in_c/_reml_grp/practical_c.reml_lib
On: 3/3/2003 at 16:27:16
Options: reml2 -i noindex -l long -o html -p multiple