Program # 21: Program to find out exponent of given number
//Program to find out the exponent of given number(Level - Medium)
#include <iostream.h>
#include <conio.h>
#include <conio.h>
void main ()
{
clrscr();
int i,base,power; double res;
cout<<"Enter the base of the number = ";
cin >> base;
cin >> base;
cout<<"Enter the power of the number = ";
cin >> power;
res = 1;
for (i=1;i<=power;i++)
res = res*basse;
cout<<"The result is = "<<res;
getch ();
cout<<"The result is = "<<res;
getch ();
}
0 Comments