#include <stdio.h>
#include <conio.h>
void main()
{
int i,base,index,power=1;
clrscr();
printf("Enter the base and index");
scanf("%d%d",&base,&index);
for(i=0;i<index;i=i+1)
{
power=power*base;
}
printf("%d",power);
getch();
}
#include <conio.h>
void main()
{
int i,base,index,power=1;
clrscr();
printf("Enter the base and index");
scanf("%d%d",&base,&index);
for(i=0;i<index;i=i+1)
{
power=power*base;
}
printf("%d",power);
getch();
}
ReplyDeleteVery informative article.Thank you author for posting this kind of article .
http://www.wikitechy.com/view-article/power-function-in-c-with-example-and-explanation
Both are really good,
Cheers,
Venkat