Anonymous

The Factorial Of Any Integer Factorial In C++ Program?

2

2 Answers

Anonymous Profile
Anonymous answered
#include

int factorial(int);

void main(void) {
int number;

cout > number;
if (number < 0)
cout
Anonymous Profile
Anonymous answered
#include<iostream.h>void main(void){int n;long int fact(int);cout<<"enter the number whose factorial is to be found:";cin>>n;cout<<"the factorial of"<<n<<"is"<<fact(n)<<endl;}long fact(int num){if(num==0)return 1;elsereturn num*fact(num-1);}

Answer Question

Anonymous