compute the nth mumber in the fibonacci sequence?
Answer Posted / d. prashant
#include<stdio.h>
#include<conio.h>
void main()
{
int a =0,b=1,c,i=2,n;
clrscr();
printf("Enter N Value : ");
scanf("%d",&n);
printf("%d\t%d\t",a,b);
while(n>i)
{
c = a+b;
printf("%d\t",c);
c=b;
b=a;
i++;
}
getch();
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
write a program in c language to print your bio-data on the screen by using functions.
Differentiate between new and malloc(), delete and free() ?
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
how to construct a simulator keeping the logical boolean gates in c
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
Which one would you prefer - a macro or a function?
Is main an identifier in c?
What is the difference between struct and typedef struct in c?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
Is fortran faster than c?
Without Computer networks, Computers will be half the use. Comment.
What is the difference between a string and an array?
What is a good way to implement complex numbers in c?
What are the 5 types of inheritance in c ++?
What does calloc stand for?