Write a Program to find a power of give no.

#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();
}

1 comment:


  1. Very 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

    ReplyDelete

Related Post

Array:
String functions:
General (Loops-for/while)
Write a Program to print reverse of a given number Write a Program to print Product of Digits (eg. 212=2*1*2=4) of a given number Write a C++ Program to Convert Binary into Decimal Number