Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int InputInt(int lowestVal, int highestVal)
- {
- int input;
- cin >> input;
- while(input < lowestVal || input > highestVal)
- {
- cout << "Wrong input, make sure it is between " << lowestVal << " and " << highestVal << ":";
- cin >> input;
- }
- return input;
- }
- int main()
- {
- int JonVar1 = 100;
- int JonVar2 = 50;
- int result = AddNumbers(JonVar1, JonVar2);
- cout << "Result: " << result << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement