title: Wrote a program that displays the fibonacci number corresponding to user input, but it starts at zero instead of one?
body: <pre><code>std::cout &lt;&lt; &quot;Input a number: &quot;;
  
          int userParameter{};
          std::cin &gt;&gt; userParameter;
  
          int firstNumber{0};
          int secondNumber{1};
  
          int sumNumber{firstNumber + secondNumber};
  
          for(int i{1};i &lt;= userParameter;i++)
          {
              sumNumber = firstNumber + secondNumber;
              firstNumber = secondNumber;
              secondNumber = sumNumber;
          }
  
          std::cout &lt;&lt; &quot;That number in the fibonacci sequence is &quot; &lt;&lt; sumNumber &lt;&lt; '\n';
  </code></pre>
  <p>So I've been working on this for an hour and this is the closest thing I can get to the desired result. My original program had the loop in its own function, but I decided that was probably a waste of space for such a small program and moved it back to the main loop. My issue is that the Fibonacci sequence starts on 0 instead of 1 for some reason. I've tried different little minor tweaks as I feel I'm close but missing a small detail somewhere. I've tried altering the value of int i, I've tried changing the location of the sumNumber initializer, and I've tried modifying int userParameter in the for loop parameters, and I can safely say I'm last as to what I could do to solve this.</p>