title: 4.5 years supposed to be 4 years and 178, How I can do that In C++
body: <p>Title is just an example. </p>
  
  <p>I am making an app in C++ and need to show the time required to achieve a given point. If I go to alpha centauri at light speed, I would reach it after 4 years 133 days, but the output is <code>4.367 years</code>. </p>
  
  <p>How can I convert <code>4.367 years</code> to <code>4 years 133 days</code>?</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      double percent = 0;
      double speed_light = 1 ; // Light/Years
      double alpha_centauri = 4.367;
      double alpha_centauri_days = 1595.0467;
  
      cout &lt;&lt; "Please inter the percentage of light speed the spaceship is flying with:\n";
      cin &gt;&gt; percent;
  
      double per_speed = percent * speed_light /100;
      double year_time = alpha_centauri / per_speed ;
      int days_time = alpha_centauri_days / per_speed ;
  
      cout &lt;&lt;"The time required to reach alpha centauri at "&lt;&lt; percent
      &lt;&lt; " percent of light speed is: \n"&lt;&lt; year_time &lt;&lt; " years!\t" &lt;&lt; days_time&lt;&lt; " days!\n";
  
      return 0;
  }
  </code></pre>