Fibonacci Series: 1 1 2 3 5 8 13 21... (means addition of next digit with previous digit). Q)Write a program to enter limit and print the...
Fibonacci Series:1 1 2 3 5 8 13 21...(means addition of next digit with previous digit).
Q)Write a program to enter limit and print the Fibonacci series.
Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages with the same logic.
Lucas Series:1 3 4 7 11 18......(means addition of next digit with previous digit).
Q)Write a program to enter limit and print the Lucas series.
Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages with the same logic.
Q)Write a program to enter limit and print the Fibonacci series.
Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages with the same logic.
P:#include<stdio.h>
Void main()
{
int i,l,a,b,c;
printf("enter limit");
scanf("%d",&l);
a=0;
b=1;
printf("%d%d",a,b);
for(i=3;i<=l;i++)
{
c=a+b;
printf("%d",c);
a=b;
b=c;
}
getch();
}
Lucas Series:1 3 4 7 11 18......(means addition of next digit with previous digit).
Q)Write a program to enter limit and print the Lucas series.
Note:-You can also create this program in c++(c plus plus),java,c#(c sharp) languages with the same logic.
P:#include<stdio.h>
Void main()
{
int i,l,a,b,c;
printf("enter limit");
scanf("%d",&l);
a=1;
b=3;
printf("%d%d",a,b);
for(i=3;i<=l;i++)
{
c=a+b;
printf("%d",c);
a=b;
b=c;
}
getch();
}
If you have any query then leave your comments and don't forgot to follow me on Google+,Facebook,Twitter.
Really nice blog,i enjoyed your infomations. Thank you and i will expect more in future.
ReplyDeleteJAVA Training in Chennai
Best JAVA Training institute in Chennai
Python Training in Chennai
Selenium Training in Chennai
Android Training in Chennai
Big data training in chennai
JAVA Training in Chennai
Java Training in Tambaram