Answer to Question #241388 in C++ for kibe

Question #241388

Write a program to determine the factorial of 4 numbers 

1
Expert's answer
2021-09-23T12:12:43-0400
#include<iostream>
using namespace std;
int main() {
	int num,factorial=1;
	cout<<" Enter number to find its factorial: ";
	cin>>num;
	for (int i=1;i<=num;i++) {
		factorial*=i;
	}
	cout<<"Factorial of Number is = "<<factorial<<endl;


	cin>>num;
	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
APPROVED BY CLIENTS