-moz-user-select:none; -webkit-user-select:none; -khtml-user-select:none; -ms-user-select:none; user-select:none;

Thursday 2 April 2015

Factorial of a number by "for" loop

Hello and Asalam o Alikum.I hope you all are fine by the grace of Allah Almighty.
In my previous blogs,I created the programs of creating factorial of a number being entered by the user by using while and do-while loop.Today I will do the same process by using for loop.
Remember that factorial in Mathematics means that suppose a user enters "4",then its factorial will be calculated as
4*3=12
12*2=24
24*1=24
So,the factorial of "4" will be 24.Below is the source code of the program.

Source code

khgamujtaba,C++

Output 

khgamujtaba,C++


No comments:

Post a Comment