stillbad.c 294 B

1234567891011121314
  1. /* stillbad.c -- a program with its syntax errors fixed */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. int n, n2, n3;
  6. /* this program has a semantic error */
  7. n = 5;
  8. n2 = n * n;
  9. n3 = n2 * n2;
  10. printf("n = %d, n squared = %d, n cubed = %d\n", n, n2, n3);
  11. return 0;
  12. }