76 976
Assignments Done
Successfully Done
In June 2019

Answer to Question #47568 in C++ for krad

Question #47568
Write a program to calculate the factorial value of the input number n! use the incrementation formula (i++) for your solution instead of decrementation formula (1--).
Sample input/output dialogue:
Enter a Number: 4
Factorial value: 24
(The computation is: 1*2*3*4=24)
Expert's answer
#include <iostream>
using namespace std;
//main method
int main()
int Number;//variable for input number
int Factorial=1;//variable for result
//promt user to enter Number
cout<<"Enter a Number: ";
//read number
for(int i=1;i<=Number;i++){
//show result
cout<<"Factorial value: "<<Factorial<<"\n";
//exit program
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions