The code below takes 5 seperate numbers user entered numbers and makes them into one number, 2 seperate times. It then takes the values and adds them together for the sum. My probelm is I don't want to have to specify how many numbers (like only 5). I want them to be able to enter numbers and when they enter a -1 the number ends. can anyone help?

Code:#include<iostream.h> int convertNumber(int [], int); void showvalues(int[]); void main () { int num1[5], num2[5]; int val1, val2; cout<< "enter number" <<endl; for (int count = 0; count < 5; count++) cin >> num1[count]; val1 = convertNumber(num1, 5); cout << val1 << endl; cout << endl; cout<< "enter number" <<endl; for (int count1 = 0; count1 < 5; count1++) cin >> num2[count1]; val2 = convertNumber(num2, 5); cout << val2 << endl; cout << endl; cout << "the sum of the numbers is: " << val1 + val2 << endl; } int convertNumber(int nums[], int arySize) { int multiplier = 1; int val = 0; for (int x = arySize - 1; x >= 0; x--) { val += nums[x] * multiplier; multiplier *= 10; } return val; }