/* Sample Exercise 1

   Write a program to generate and display a table of
   n and n squared, for integer values ranging from 1
   to 10.  Be sure to print appropriate headings.
*/
#include <stdio.h>
main ()
{

  int num;          /* a series of numbers */
  int num_squared;  /* each number squared */

  printf ("TABLE OF SQUARES FOR 1 TO 10\n\n");
  printf (" num      num squared\n");
  printf ("-----     -----------\n");
  /* loop from 1 to 10 */
  for (num = 1; num <= 10; ++num )
  {
      printf ("  %d         %d\n", num, num*num);
  }
  return (0);
}