include stdio int power int int main int for 10 printf power power -3

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include <stdio.h>
int power(int m, int n);
main()
{ int i;
for(i=0; i<10; ++i)
printf("%d %d %d\n", i, power(2,i), power(-3,i));
return 0;
}
int power(int base, int l)
{
int i, p;
p=1;
for (i=1; i<=l; ++i)
p=p*base;
return p;
}