Fibonacci challenge

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

32 Replies - 28300 Views - Last Post: 26 September 2014 - 11:20 AM

#31 p.mo  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 1
  • Joined: 02-October 12

Re: Fibonacci challenge

Posted 02 October 2012 - 07:58 PM

This is my first post and challenge. While its not very compact should be functional functional.

Spoiler

Was This Post Helpful? 1
  • +
  • -

#32 HB-aka  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 62
  • Joined: 03-June 14

Re: Fibonacci challenge

Posted 09 June 2014 - 03:02 AM

this function will get Fibonacci numbers.
i used "long integers" because the number can get to big.
so...this is the code i'v made.
Spoiler

This post has been edited by Skydiver: 09 June 2014 - 08:22 PM
Reason for edit:: Put code in spoiler tags to keep challenge fresh for late comers.

Was This Post Helpful? 0
  • +
  • -

#33 tifuy95  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 26-September 14

Re: Fibonacci challenge

Posted 26 September 2014 - 11:20 AM

I am a new programer can someone give me feedback on my code??
// Made by Max Bentata

//09/21/2014

#include <iostream>
using namespace std;



int main()
{
int x = 0; 
int fib = 0;
int sum = 1;
int marker = 0;


    cout << x << endl;
    x = fib + sum;
    cout << x << endl;
    fib = x + sum;
    cout << fib << endl;

    x = fib + sum;
    cout << x << endl;


    while (mkr < 15){
        sum = x + fib;
        cout << sum << endl;
        fib = sum + x;
        cout << fib << endl;
        x = fib + sum;
        cout << x << endl;
        marker++;
}

  return 0;
}


Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3