/************************************************************************
*																		*
* ders 9 ornekleri - Deniz Demiray										*
* fonksiyon call by value / call by reference ornegi 1					*
* derlemek icin gcc -o program_ismi 4.c									*
*																		*
************************************************************************/

#include <stdio.h>
#include <stdlib.h>

int fact(int p)     
{
	if (p==0)
        return 1;
    else
	    return p*fact(p-1);	
}

int main()
{
	int a;
	
	printf("Calculating the factorial of a: \n");
	printf("Enter the value of a: \n");
	
	scanf("%d", &a);

	printf("the factorial of %d = %d\n",a, fact(a));
    
    system("pause");	
	return 0;
}


