#include using namespace std; #include "prompt.h" // a few attempts to swap two things // rcd@cs.duke.edu void BadSwap (int a, int b) { int temp = a; a = b; b = temp; } void Swap (int & a, int & b) { int temp = a; a = b; b = temp; } int main () { int num1 = PromptRange("Enter a number ", 1, 100); int num2 = PromptRange("Enter another number ", -100, -1); cout << "Your numbers were: " << num1 << " and " << num2 << endl; BadSwap(num1, num2); cout << "Your numbers are: " << num1 << " and " << num2 << endl; Swap(num1, num2); cout << "Your numbers are: " << num1 << " and " << num2 << endl; return 0; }