what is the code of the output of print the 10 fibonacci
number series

Answers were Sorted based on User's Feedback



what is the code of the output of print the 10 fibonacci number series..

Answer / arun asokan

#include<stdio.h>
#include<conio.h>
void main()
{
int a=0,b=1,c,limit=8;
clrscr();
printf("%d\t%d",a,b);
for(n=1;n<=limit;n++)
{
c=a+b;
a=b;
b=c;
printf("\t%d",c);
}
getch();
}

Is This Answer Correct ?    4 Yes 0 No

what is the code of the output of print the 10 fibonacci number series..

Answer / prassatharun

#include<stdio.h>
void main()
{
int a=0,b=1,c,limit=10,n=1;
clrscr();

printf("%d\n%d",a,b);
while(n<=limit)
{
c=a+b;
a=b;
b=c;
printf("\n%d",c);
n++;
}
getch();
}

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Code Interview Questions

main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

9 Answers   CSC, GoDB Tech, IBM,


main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 Answers  


#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }

2 Answers  


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


what is the code of the output of print the 10 fibonacci number series

2 Answers  






Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


What are the following notations of defining functions known as? i. int abc(int a,float b) { /* some code */ } ii. int abc(a,b) int a; float b; { /* some code*/ }

1 Answers  


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 Answers  


Write a program to receive an integer and find its octal equivalent?

7 Answers  


struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


Categories