You are viewing a single comment's thread. Return to all comments →
you are awesome man
int main() { int i=2,x,y,n; int z,a[100]={0}; scanf("%d %d %d",&x,&y,&n);
while(i<n)
{ z=0; z=x+pow(y,2); x=y; y=z; i++; a[z]+=z; } printf("%d",a[z]); return 0; }
this my code it is displaying segementation error can anyone help me in getting the actual bug in this code
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
you are awesome man
include
include
include
include
int main() { int i=2,x,y,n; int z,a[100]={0}; scanf("%d %d %d",&x,&y,&n);
{ z=0; z=x+pow(y,2); x=y; y=z; i++; a[z]+=z; }
printf("%d",a[z]); return 0; }
this my code it is displaying segementation error can anyone help me in getting the actual bug in this code