[plain]
#include <stdio.h>
int main()
{
int i;
int a;
int b;
int c;
int n;
printf("please enter a number:");
scanf("%d", &n);
a=b=1;
for(i=3; i<=n; i++)
{
c=a+b;
a=b;
b=c;
}
printf("The result is %d\n", c);
return 0;
}
#include <stdio.h>
int main()
{
int i;
int a;
int b;
int c;
int n;
printf("please enter a number:");
scanf("%d", &n);
a=b=1;
for(i=3; i<=n; i++)
{
c=a+b;
a=b;
b=c;
}
printf("The result is %d\n", c);
return 0;
}