#include <stdio.h>
float a(int n);
main()
{
int N;
float z;
puts("Dose to n (>=2)");
scanf("%d",&N);
z=a(N);
printf("Gia n=%d h anadromikh sxesh dinei %f
",N,z);
}
float a(int n)
{
if(n==2)
return (7);
else if(n==3)
return ((8*49-1)/1);
else
return ((8*a(n-1)*a(n-1)-1)/a(n-2));
}
guys can you please explain me how this program works? i mean, if i put for example n=8 , how will it find a7,a6 etc so it get the a8 ??
See Question&Answers more detail:os