squares.c 236 B

1234567891011121314
  1. /* squares.c -- produces a table of first 20 squares */
  2. #include <stdio.h>
  3. int main(void)
  4. {
  5. int num = 1;
  6. while (num < 21)
  7. {
  8. printf("%4d %6d\n", num, num * num);
  9. num = num + 1;
  10. }
  11. return 0;
  12. }