Skip to content

Instantly share code, notes, and snippets.

@alonzoibarra97
Created April 5, 2016 09:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonzoibarra97/9ec750926f49c6bed006fe77ccfdaacb to your computer and use it in GitHub Desktop.
Save alonzoibarra97/9ec750926f49c6bed006fe77ccfdaacb to your computer and use it in GitHub Desktop.
#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