|
//programmin by A. Najafzadeh -
Tuesday, March 07, 2006
#include <iostream.h>
#include <conio.h>
double fp(int x);
double fp(int x , int y);
main()
{
int a , b;
cin>>a>>b;
cout<<fp(a)<<'\t'<<fp(b)<<'\n';
cout<<fp(a,b)<<'\t'<<fp(b,a);
getch();
}
//////////func fp for fac
double fp(int x)
{
double fact = 1;
for(int i = 1; i <= x; i++)
fact *= i;
return fact;
}
/////////func fp for power
double fp(int x , int y)
{
double pow = 1;
for(int i = 1; i <= y; i++)
pow *= x;
return pow;
} |