Skip to content

Instantly share code, notes, and snippets.

@daemonfire300
Created February 2, 2013 15:52
Show Gist options
  • Save daemonfire300/4697937 to your computer and use it in GitHub Desktop.
Save daemonfire300/4697937 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
using namespace std;
void fac(int n)
{
int ret = 1;
for(int i=1; i < (n+1); i++)
{
ret *= i;
}
cout << ret << endl;
}
int main()
{
fac(1);
fac(2);
fac(3);
fac(4);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment