Question:

A question about C(programming language)?

by  |  earlier

0 LIKES UnLike

What is the code for this program?

Enter number:

(user input here, where this is the number of times the program will count in fibonacci sequence)

(for example!!)

Enter number: 7

1 1 2 3 5 8 13

(how can i make this program in turbo C?)

basic codes only!! no C++ codes!!

please help!! =(

 Tags:

   Report

3 ANSWERS


  1. Look up Fibonacci in Wikipedia.  That should get you going.

    For Roman Numerals, the basic approach is to start with the big numbers first.  Let's say you have this translation:

    m 1000

    d 500

    c 100

    50 l

    10 x

    5 v

    1 i

    And you have 687.  You'd see if there are any 1000's.  There aren't, so you go to the next - 500.  You subtract 500, spit out a 'd', and are left with 187.  There aren't any more 500's, so you go on to 100's.  There is one, you spit out a 'c', and are left with 87.  You find that there's a 50, and spit out an 'l', and you're left with 37.  And so on.  But 900 is 'cm', and 400 is 'cd'.  You could just put these in your table.


  2. learn to do your own homework...!!!!

  3. here is the program..

    #include<stdio.h>

    #include<conio.h>

    void main(void)

    {

    int i,j,k,n;

    clrscr();

    i=0;

    j=1;

    printf("%d %d ",i,j);

    for(n=0;n<=5;n++)

    {

    k=i+j;

    i=j;

    j=k;

    printf("%d ",k);

    }

    getch();

    }

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.