-
-
Save alonzoibarra97/9ec750926f49c6bed006fe77ccfdaacb to your computer and use it in GitHub Desktop.
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> | |
using namespace std; | |
int main (){ | |
int num, factorial=1; | |
cout<< "enter a number to find its factorial"; | |
cin>>num; | |
for(int a=1; a<=num ;a++) | |
{ | |
factorial= factorial*a; | |
} | |
cout<< "the factorial of the number given is: "<< factorial; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment