You are on page 1of 1

#include <conio.

h>
#include <stdio.h>

int main()
{
int i,j=0,p=0,c=1,n,sum=1;
clrscr();
printf("\nEnter n:");
scanf("%d",&n);
printf("\n1 +");
for(i=0;i<n;i++)
{
j=c+p;
p=c;
c=j;
sum+=j;

if(i==n-1)
printf(" %d ",j);
else
printf(" %d +",j);
}
printf("=%d",sum);

getch();
return 0;
}