/* * File: * testpower.c * Authors: * Brian W. Kernighan * Dennis M. Ritchie * Samuel A. Rebelsky * Version: * 1.1 of 31 January 2003 * Summary: * Print out various tests of the power function. * Citation: * Closely based on an unnamed program on page 24 of K&R. */ /* +---------+-------------------------------------------------------- * | Headers | * +---------+ */ #include #include #include "power.h" /* +------+----------------------------------------------------------- * | Main | * +------+ */ main() { int i; /* Counter variable for for loops. */ for (i = 0; i < 10; ++i) printf("i: %d | 2^%d: %6d | -3^%d: %6d\n", i, i, power(2,i), i, power(-3,i)); exit(EXIT_SUCCESS); } /* main */