title: How do you read values from a text file in c++?
body: <p>Basically I have to take 2 values (the students score and the total amount of points) from a text file that reads </p>
  
  <pre><code>    97 127
  </code></pre>
  
  <p>and print out the students percentage.</p>
  
  <p>This is my code </p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;fstream&gt;
      #include &lt;string&gt;
      #include &lt;cmath&gt;
      using namespace std;
  
      int main()
      {
        int student_score;
        int total_points;
        int final_score;
  
        ifstream inFile;
        inFile.open("myData.txt");
  
        inFile &gt;&gt; student_score &gt;&gt; total_points;
  
        final_score = (student_score / total_points) * 100;
  
        cout &lt;&lt; final_score;
  
        inFile.close();
        return 0;
      }
  </code></pre>
  
  <p>My problem is that when I run the program the value comes out to be </p>
  
  <pre><code>    3608900 
  </code></pre>
  
  <p>And when I just ask to print out the student_score value it prints out a completely different number.</p>