How can i make it so that the user can only enter numbers? if they were to enter a letter the program breaks.
cin >> num1;
cin >> num2;
cout << "the sum is" << num1 + num2;
How can i make it so that the user can only enter numbers? if they were to enter a letter the program breaks.
cin >> num1;
cin >> num2;
cout << "the sum is" << num1 + num2;