All pastes #403031 Raw Edit

Someone

public text v1 · immutable
·published 2007-03-20 03:41 UTC
rendered paste body
#include <iostream>
 
using namespace std;
 
int main ()
{
    char ch;
    int num1;
    int num2;
    int num3;
    int userinput;
    int sum; //stores the total values
    int sequence; //count the place in sequence
    bool dostart; //
    dostart = 1;
    sequence = 2;
    
         cout << "Enter two numbers: \n";
         cin >> num1;
         cin >> num2;
         
         //verification process goes here
         
         cout << "Enter a number and i'll find the Fibonnaci sequence:  \n";
         cin >> userinput;
         
         sum = num1 + num2;
         num3 = 0;
         
         int lastvar;
         
         //equals two to enter this statement
         while (sequence < userinput)
         {
             sequence++;  //makes it three
             
             do
             {
                  if (sequence < userinput +1)
                  {
                     lastvar = num2;   
                     sum = sum + lastvar;
                  }       
             }             
             while(1);
             
                          
         }



         cout << sum;
         
         
         
    
    cin >> ch;
    return 0;
}