FACTORIAL.CPP SOURCE CODE
/*FACTORIAL.CPP*/
#include "calculator.h"
#include <iostream>
using namespace std;
void ScientificCalculator::factorial()
{
int num,factorial=1;
cout<<" Enter Number To Find Its Factorial: ";
cin>>num;
for(int a=1;a<=num;a++)
{
factorial=factorial*a;
}
cout<<"Factorial of Given Number is ="<<factorial<<endl;
}
#include "calculator.h"
#include <iostream>
using namespace std;
void ScientificCalculator::factorial()
{
int num,factorial=1;
cout<<" Enter Number To Find Its Factorial: ";
cin>>num;
for(int a=1;a<=num;a++)
{
factorial=factorial*a;
}
cout<<"Factorial of Given Number is ="<<factorial<<endl;
}
Comments
Post a Comment