Answer to Question #171552 in C++ for Abdul Nasir

Question #171552

write c++ program find factorial number input


1
Expert's answer
2021-03-14T11:27:17-0400
#include<iostream>
using namespace std;
int main() {
	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;
	return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS