/************************************************************************
*																		*
* 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 power(int p, int q)      //p^q (q>=0)
{
	if (q==0)
        return 1;
    else
	    return p*power(p,q-1);	
}

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

	printf("%d^%d = %d\n",a, b, power(a,b));
    
    system("pause");	
	return 0;
}


