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
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Explain union. What are its advantages?
Why do we use header files in c?
How can I make sure that my program is the only one accessing a file?
Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250
How to implement a packet in C
Explain what is output redirection?
What is %lu in c?
Explain is it valid to address one element beyond the end of an array?
What is context in c?
simple program of graphics and their output display
Can a void pointer point to a function?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
Here is a neat trick for checking whether two strings are equal
Write a factorial program using C.