home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 98.img / LCNOW2.ZIP / EXAMPLES / PWRTABLE.C < prev    next >
C/C++ Source or Header  |  1988-06-25  |  394b  |  26 lines

  1. /*
  2.  * P W R T A B L E
  3.  *
  4.  * Print a table of powers.
  5.  */
  6.  
  7. main()
  8. {
  9.     int n;        /* table index */
  10.  
  11.     /*
  12.      * Label the columns.
  13.      */
  14.     puts("number\t exp2\t exp3\t exp4");
  15.     puts("------\t-----\t-----\t-----");
  16.  
  17.     /*
  18.      * Print the table of power values.
  19.      */
  20.     for (n = 0; n <= 10; ++n)
  21.         printf(" %2d\t%5d\t%5d\t%5d\n",
  22.             n, n * n,  n * n * n,  n * n * n * n);
  23.  
  24.     return (0);
  25. }
  26.