70. Make a series : 0 1 1 2 3 5 8 13
#include<stdio.h>
void
main()
{
int num1,num2,num3,i;
printf("Make a series : 0 1 1 2 3
5 8 13 \n");
printf("Enter 1st number: ");
scanf("%d",&num1);
printf("Enter 2nd number: ");
scanf("%d",&num2);
printf("%d %d ",num1,num2);
for(i=0;i<15;i++)
{
num3 = num1 + num2;
printf("%d ",num3);
num1=num2;
num2=num3;
}
printf("\n");
}
Comments
Post a Comment