Created
April 24, 2012 06:54
-
-
Save uugr/2477222 to your computer and use it in GitHub Desktop.
Factrorial calculation In C
This file contains hidden or 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 <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