Created
August 13, 2017 15:20
-
-
Save 0xDaksh/28a66d13ad17a098e27ad6d4cb2f01a8 to your computer and use it in GitHub Desktop.
Factorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream.h> | |
#include <math.h> | |
int main() | |
{ | |
int d = 0; | |
int q = 1; | |
cout<<"enter number"<<endl; | |
cin>>d; | |
for(int a = 1; a <= d; a++) { | |
q = q * a; | |
} | |
cout<<"the factorial is "<<q; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment