Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int InputInt(int lowestVal, int highestVal)
  6. {
  7.     int input;
  8.     cin >> input;
  9.     while(input < lowestVal || input > highestVal)
  10.     {
  11.         cout << "Wrong input, make sure it is between " << lowestVal << " and " << highestVal << ":";
  12.         cin >> input;
  13.     }
  14.     return input;
  15. }
  16.  
  17. int main()
  18. {
  19.     int JonVar1 = 100;
  20.     int JonVar2 = 50;
  21.     int result = AddNumbers(JonVar1, JonVar2);
  22.     cout << "Result: " << result << endl;
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement