Skip to content

Instantly share code, notes, and snippets.

@uugr
Created April 24, 2012 06:54
Show Gist options
  • Save uugr/2477222 to your computer and use it in GitHub Desktop.
Save uugr/2477222 to your computer and use it in GitHub Desktop.
Factrorial calculation In C
#include <stdio.h>
unsigned long faktoriyel(int); //prototip tanımı
int main ()
{
long deg1;
deg1=faktoriyel(14);
printf ("14!=%ld\n",deg1);
return 0;
}
unsigned long faktoriyel (int n)
{
long fktryl=1;
while (n>1)
{
fktryl *=n;
n--;
}
return fktryl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment