GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Aztec Systems  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 2 of 8    Print  
Write a program to implement the Fibonacci series

  
Total Answers and Comments: 7 Last Update: September 18, 2009   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: baseersd
 

#include<stdio.h>

int main()
{
    unsigned int i=0,j=0,sum=1,num;
    printf("nEnter the limit for the series ");
    scanf("%d",&num);
    while(sum<num)
    {
       printf("%d ",sum);
        i=j;
        j=sum;
        sum=i+j;
                      
    }
   
  
  getch();  
}



Above answer was rated as good by the following members:
sriranga.ch
July 27, 2007 10:08:22   #1  
baseersd Member Since: June 2007   Contribution: 34    

RE: Write a program to implement the Fibonacci series

#include<stdio.h>

int main()
{
unsigned int i 0 j 0 sum 1 num;
printf("nEnter the limit for the series ");
scanf(" d" &num);
while(sum<num)
{
printf(" d " sum);
i j;
j sum;
sum i+j;

}


getch();
}


 
Is this answer useful? Yes | NoAnswer is useful 5   Answer is not useful 1Overall Rating: +4    
October 08, 2008 03:14:30   #2  
memo132006 Member Since: October 2008   Contribution: 1    

RE: Write a program to implement the Fibonacci series

#include <iostream>

using namespace std;

void main()

{

int limit sum 0 i 1 j;cout<<"please enter the limit of the series ";

cin>>limit;

while(sum< limit)

{

cout<<sum<<endl;

j sum;

sum+ i;

i j;

}

}


 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
May 01, 2009 11:00:21   #3  
pullaiah06 Member Since: September 2008   Contribution: 1    

RE: Write a program to implement the Fibonacci series
#include<stdio.h>
#include<conio.h>
{
int m 0 1 size sum k;
printf("ENTER THE SIZE OF THE series"

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
May 03, 2009 03:05:41   #4  
trogen Member Since: May 2009   Contribution: 1    

RE: Write a program to implement the Fibonacci series
#include<stdio.h>
#include<conio.h>
void main()
{
int a b c;
clrscr();
c a+b;
a b;
b c;
printf("n d" a);
getch();
}

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
June 19, 2009 11:52:06   #5  
bhaumikshah04 Member Since: January 2009   Contribution: 1    

RE: Write a program to implement the Fibonacci series
#include<stdio.h>
#include<conio.h>

void main()
{
int number;
clrscr();
printf("Enter number till which fibonacci series");
scanf(" d" &number);
for(int first 0 second 1 temp;number> second;temp second second first+second first temp)
printf("n d" second);
getch();
}

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    
September 13, 2009 08:54:06   #6  
vigneshwaransankaran Member Since: September 2009   Contribution: 3    

RE: Write a program to implement the Fibonacci series

#include

main()

{

int a b c n;

a 0;

b 0;

c 1;

printf( enter the value of n );

scanf( d &n);

while(n>0)

{

printf( the fibanocci series is d c);

a b;

b c;

c a+b;

n--;

}

}


 
Is this answer useful? Yes | No
September 18, 2009 14:07:56   #7  
sarabjit Member Since: August 2009   Contribution: 14    

RE: Write a program to implement the Fibonacci series
int main()
{
int n i f1 0 f2 1 f3 0;
printf("Enter number of terms : ");
scanf(" d" &n);
if(n 1)
printf("0");
if (n 2)
printf("0 1");
if(n> 3)
{
for(i 3;i< n;i++)
{
f3 f1+f2;
f1 f2;
f2 f3;
printf(" d" f3);
}
}
return 0;
}

 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape