#include<stdio.h>
int fibo(int n)
{
if(n==0)
return 0;
int i;
int prevFib=0,curFib=1;
for(i=1;i<=n-1;i++)
{
int nextFib = prevFib + curFib;
prevFib = curFib;
curFib = nextFib;
}
return curFib;
}
int main()
{
int r = fibo(10);
printf("%d",r);
return 0;
}
a) 34
b) 55
c) Compile error
d) Runtime error
What will be the output when the following code is executed?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the output when the following code is executed?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!