Page 3 of 3 FirstFirst 123
Results 21 to 29 of 29
  1. #21

    try VB sa fibo series... lingaw au

  2. #22
    Iterative Solution with only three variables used.

    Code:
    #include <stdio.h>
    #include <conio.h>
    
    void main() {
    int x, a, b;
    
    clrscr();
    
    a = 1; b = 0;
    
    printf("How many Fibonacci numbers to display? : ");
    scanf("%i",&x);
    
    printf("Displaying [%i] Fibonacci Numbers:\n",x);
    
    while(x<=1){
      a = a + b;
      b = a - b;
      printf("[%5i]", b);
    
     x--;
    }
    getch();
    }
    Last edited by ChaosOrb; 07-02-2009 at 11:10 AM. Reason: added variable x in 2nd printf

  3. #23
    Small typo error.

    Quote Originally Posted by ChaosOrb View Post
    Code:
    #include <stdio.h>
    #include <conio.h>
     
    void main() {
    int x, a, b;
     
    clrscr();
     
    a = 1; b = 0;
     
    printf("How many Fibonacci numbers to display? : ");
    scanf("%i",&x);
     
    printf("Displaying [%i] Fibonacci Numbers:\n",x);
     
    while(x>=1){
      a = a + b;
      b = a - b;
      printf("[%5i]", b);
     
     x--;
    }
    getch();
    }

  4. #24
    void fibo(int x, int y, int iter)
    {
    int temp;

    if (iter)
    {
    printf("%d ", x);
    temp = y;
    y += x;
    x = temp;

    iter--;
    }
    else
    return;
    fibo(x, y, iter);
    }

    int main(int argc, char* argv[])
    {
    int iter;
    printf("Enter iterations: ");
    scanf("%d", &iter);
    printf("Fibonacci sequence [%d]: ", iter);
    fibo(0, 1, iter+1);
    printf("\n");
    return 0;
    }

  5. #25

    Cool Fibonacci Series Using While

    hi guys new po me dito try this code for generating fibonacci series

    hope this code may help you!!!! ^__________________________^

    #include <stdio.h>
    #include <conio.h>

    main(){

    int num,x,row,res,num1;

    clrscr();

    row=1;
    num=1;
    x=0;

    printf("Enter Number To Generate Fibonacci Series: ");
    scanf("%d",&num1);

    while (row<=num1){

    res=num+x;
    num=x;
    x=res;
    printf("%d ",res);
    row=row+1;

    }

    getch();
    }

  6. #26
    hahah! i cn stll rmmbr during college we ussually ask help here^^

  7. #27
    Quote Originally Posted by BackBeat View Post
    hehehe hatag man mo code saons.. let him discover kng unsaon para makasabot gyud.. hehe hatagan ninyo code wa pa gani kasabot unsa dagan sa fibonacci...
    agree ko ani niya. di jud na makat-on. wa man gani kabalo unsay fibonacci niya naa nay code.

  8. #28
    daghana answer oh..papili-ah imo teacher assa ana . haha

  9. #29

    Default Having problem with fibonacci!

    Unsay usbon ani
    para ang result kay 1 1 2 4 7
    #include<stdio.h>

    int main()
    {
    float a,maxn,b,c,d;
    printf("Enter maximumn number of values in series \n");
    scanf("%f",&maxn);
    a=;b=;
    printf("\n\n") ;
    printf("%1.0f\n",a);
    printf("%1.0f\n",a);
    for(d=1;d<=maxn-2;d++)
    {

    c=a+b;
    b=a;
    a=c;
    printf("%1.0f\n",c) ;

    }
    getch();
    }

  10.    Advertisement

Page 3 of 3 FirstFirst 123

Similar Threads

 
  1. MGA BRO: HELP ABOUT VIDEO RENTAL SYSTEM IN VB LANGUAGE
    By peewee711 in forum Programming
    Replies: 12
    Last Post: 09-14-2010, 03:51 AM
  2. VB.Net code in creating database...
    By janjerell in forum Programming
    Replies: 6
    Last Post: 07-08-2010, 08:57 PM
  3. Dota cheat codes in multi player
    By chriztophers in forum Software & Games (Old)
    Replies: 124
    Last Post: 01-03-2010, 11:37 AM
  4. Codes in creating ICM
    By Burn Out in forum Software & Games (Old)
    Replies: 3
    Last Post: 12-04-2009, 09:21 AM
  5. How to write code in vb6 to communicate with the printer?
    By leyarchitecture in forum Programming
    Replies: 5
    Last Post: 02-24-2009, 06:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top