get data from other function

i done the part that user can enter 10 score or less. the problem thing is i want to calculate the perfect score.the perfect score is 100.
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void getScores(int num])//function that get the user to enter the data
{
			for(int i=0;i<10;i++)
			{
						cout << "enter number(1-100)(-1 to quit)"<<endl; 
			//the data can't less than 1 and can't more than 100.it suppose when user enter -1,the program stop from prompt the user to enter the data and return.but i don't know how to do it.

					cin>>num; 
				         while (num <100 ||  num >100 )
					{	
							cout <<"invalid score"<<endl;
							cout << "enter number(1-100)(-1 to quit)"<<endl;
							cin>>num;
					}
			}

}
Last edited on
i'm sorry, but i can't understand what you write?
while (num<100||num>100)??
Topic archived. No new replies allowed.