View Code of Problem 23

#include<stdio.h>
#include<string.h>
#include<math.h>



int main(){
	
	int a[50]={1,2};
	for(int i=2;i<50;i++)a[i]=a[i-1]+a[i-2];
	int b;
	while(scanf("%d",&b)!=EOF)
	{
		if(n==0)return 0;
	
		printf("%d",a[b-1]);
	}
}
/*
Main.c: In function 'main':
Main.c:14:6: error: 'n' undeclared (first use in this function)
   if(n==0)return 0;
      ^
Main.c:14:6: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 23