I have added some traces for your convinience... hope they will help you to understand what is going on
Code:
#include <stdio.h>
int three_powered(int power);
int main(void)
{
int a=0, fin;
puts("Enter an exponent: ");
scanf("%d", &a);
printf("\n3 to the power of %d is %d",a,three_powered(a) );
puts("\n\nEnter a digit...");
scanf("%d", &fin);
return 0;
}
int three_powered(int power)
{
if(power<1)
{
printf ("3^0 == 1\n");
return 1;
}
else
{
int res = 3*three_powered(power-1);
printf ("3^%d == %d\n", power, res);
return(res);
}
}