home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
98.img
/
LCNOW2.ZIP
/
EXAMPLES
/
PWRTBL2.C
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-25
|
407b
|
30 lines
/*
* P W R T B L 2
*
* Print a table of powers.
*/
#include "macros.h"
#define MAXN 10
main()
{
int n;
/*
* Label the columns.
*/
puts("number\t exp2\t exp3\t exp4");
puts("------\t-----\t-----\t-----");
/*
* Print the table of power values.
*/
for (n = 0; n <= MAXN; ++n)
printf("%2d\t%5d\t%5d\t%5d\n",
n, SQR(n), CUBE(n), QUAD(n));
return (0);
}