Show the exact screen-output of each of the following programs:

c)

Code:
#include <stdio.h>
int f (int a)
{
if (a== 1)
return 1;
else if (a==2)
return 3;
else 
return (f(a-1) + f(a-2));
} //end of function
void main ()
{
int n;
printf ("Enter n:\n");
scanf ("%d", &n);
printf("%d", f(n));
}
Hint: Assume entered value of n = 6


answer:18
===========================================


Code:
#include<stdio.h>

 

int myfunction(int p, int q)

{

if (p == q)

return p;

else if (p < q)

return myfunction(q - p, p);

else

return myfunction(p - q, q);

}

 

void main()

{

int result;

result=myfunction(20,4);

printf("%d",result);

}
answer:4




my question is how to get the answer????