#WSQ09 Factorial Calculator

In case you might need it, here is the code

And I used this web page to help me out: http://fahad-cprogramming.blogspot.mx/2013/02/program-to-find-factorial-in-C-Programming.html

 

Well now to begin with this awsome factorial calculator we shall start as we had before

#include<iostream>

using namespace std;

Then we show that the numbers we will be using are “int” for num, factorial, else we could use “float” but “int” is the one we choose for this program.

So we ask for the number we will be getting the factorial

Screenshot8.1

Then we proceed to show what “a” would be in order to make this factorial calculator work a=1;a<=num;a++ sayin that a would be 1 until it’s lower or equal to the number you introduce at the beginning, and saying that a would increase 1 each time until it’s equal to your first number

In order to get the factorial the formula we would be using is ” factorial=factorial*a;  ” showing that the factorial will multiply “a” in order to get the right factorial number.

Screenshot8.2.png

Finally you will be giving out the result of the factorial of the number the user wrote in, and never forget ” return 0; ” otherwise your program might not work.

 

 

CC BY-SA 4.0 #WSQ09 Factorial Calculator by canadamike17 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.