I have a void function that asks the user for 5 different scores. This function should be called 5 different times in the main function, one time for every score. How do I get it to store all 5 different scores if I only have one variable?
As E A Student says you could use an array in which to store the five different scores
So, l2 should read .................for(int i=0;i<5;i++)
and l5 should read .................int a[i]=score;//now each score will be stored as an int in array a. (don`t forget to declare array a)
Your code needs to be consolidated somewhat because the first score input is not covered by the while loop clause.