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:

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