Access over 35 million academic & study documents

Convert the following procedural program, which calculates a Factoria

Content type
User Generated
Showing Page:
1/2
Convert the following procedural program, which
calculates a Factorial, into a program that uses a class to
calculate the factorial. #include int factorial(int); int
main(void) {int number; cout number; if (number
Solution
#include
#include
class factorial
{
int num;
public:
void getinfo()
{
cout<<\"\ Enter the number for which the factorial is to be
found : \"; cin>>num;
}
void facto()
{
int i,fact=1;
if(num==0||num==1)
cout<<\"\ Factorial of \"<

Sign up to view the full document!

lock_open Sign Up
Showing Page:
2/2

Sign up to view the full document!

lock_open Sign Up
Unformatted Attachment Preview
Convert the following procedural program, which calculates a Factorial, into a program that uses a class to calculate the factorial. #include int factorial(int); int main(void) {int number; cout number; if (number Solution #include #include class factorial { int num; public: void getinfo() { coutnum; } void facto() { int i,fact=1; if(num==0||num==1) cout ...
Purchase document to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.
Studypool
4.7
Indeed
4.5
Sitejabber
4.4