write a program for fibonaci series by using while loop in c?
Answer Posted / shamantha
main()
{
int a=0,b=1,c,n;
printf("enter n value");
scanf("%d",&n);
Printf("%d%d",a,b);
while(n-2>0)
{
c=a+b;
printf("%d",c);
a=b;
b=c;
n=n+1;
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Does c have circular shift operators?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
Explain zero based addressing.
What is c basic?
What is typedef example?
What is the maximum no. of arguments that can be given in a command line in C.?
How can I ensure that integer arithmetic doesnt overflow?
What is the difference between %d and %i?
Why is it usually a bad idea to use gets()? Suggest a workaround.
What is wrong with this code?
Write a program to find the biggest number of three numbers in c?
What is the difference between new and malloc functions?
Can we use visual studio for c?
Can the size of an array be declared at runtime?
How do you generate random numbers in C?