DOUBLE C++ PRODRAM by zuhaibriaz

VIEWS: 4 PAGES: 1

More Info
									#include <iostream.h>
#include <stdlib.h>

double RTP(double, int);

main()
{
int i,o;
double x;

cout<<"Enter the number"<<'\t';
cin>>x;
cout<<"Enter the power of the number";
cin>>i;
o = RTP(x,i);
cout<<x<<" raise to "<<i<<" is "<<o<<'\n';
system("PAUSE");
}
double RTP (double x, int power)
{
double result;
result=x;

for(int i=1; i<=power; i++)
{
result*=i;
}
return result;
}

								
To top