Read post
#include <stdio.h>
int main()
{
int i;
while(scanf("%d", &i))
{
switch(i)
{
case 0: printf("The Fibonacci number for 0 is 0\n"); break;
case 1: printf("The Fibonacci number for 1 is 1\n"); break;
....
case 40: printf("The Fibonacci number for 40 is 102334155\n"); break;
}
}
return 0;
}
Reply
|