Gargit

Variable Exercises Part 4.

Jul 26th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. void main()
  4. {
  5.     int a, b, c;
  6.     std::cout << "Enter first integer: ";
  7.     std::cin >> a;
  8.     std::cout << "\nEnter second integer: ";
  9.     std::cin >> b;
  10.     std::cout << "\nFirst int: " << a << ". Second int: " << b << std::endl;
  11.     c = a;
  12.     a = b;
  13.     b = c;
  14.     std::cout << "Swapped first int: " << a << ". Second swapped int: " << b << std::endl;
  15.  
  16.     system("pause");
  17. }
Advertisement
Add Comment
Please, Sign In to add comment