c++ how to write a loop based on user input help please : my question is, how do I run a loop based on the user input? 
example: 

I ask how many students does the user want to calculate the grade. 

if the user enters 2 students 

then I will ask the user to input grades for exams, homework, quiz etc... 

after the program calculate the first student grade, how do I run the loop again for the second student? 

I tried using a while loop but it just goes to infinite loop. 

what I did was: 

cout << "number of student you want to calculate grade for" << endl; 

cin >> student; 

while (student) { 
... 
... 
... 
... 
} 

when I run this it goes to infinite loop. 

help!!!!