Factorials

In this WSQ I used the factorials, and what is that? you maybe are asking, this is a factorial: 

 

In mathematics, the factorial of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal ton. For example,

5! = 5  times  4  times  3  times  2  times  1 = 120.

And I´m here, yeah, you can ask me whatever about it, if I don´t know maybe I can talk with my classmates and help you, you little human, jajaja :).

 

 <iostream>

<cmath>

 using namespace std;

int main(){

    int num, factorial= 1;

cout<<"Enter number to find it´s factorial: ";

cin>>num;

for (int a=1; a<= num; a++)

{

factorial= factorial*a;

}

cout <<"The factorial is:  over 9000 "<<endl; 

cout <<"Na, I´m joking, this is the real:  "<<factorial<<endl;

cout<<"Thanks for visiting us, see you "<<endl;

return 0;

}

 

Github link (This dark place where I save all my programs if you want, take a look over here):

 https://github.com/MarAnMu13575/-WSQ09-Factorials/tree/master

CC BY 4.0 #WSQ09 Factorial by maran13575 is licensed under a Creative Commons Attribution 4.0 International License.