C++ Program to Swap Two Numbers Without Using Temporary Variable

Write a Program to Swap Two Numbers without Using Temporary Variable.
- Program to Implement the Concept of a Stack Using Class and Object
- Program to Calculate the Factorial Using While
Algorithm
- Start the program
- Input a, b
- s=a+b, a=s-a, b=s-b
- Display a, b
- End the program
Source Code
#include<iostream> using namespace std; int main() { int a,b,s; cout<<"Enter two integer numbers:"; cin>>a>>b; cout<<"\nThe entered numbers are: "<<"a = "<<a<<" b = "<<b; s=a+b; a=s-a; b=s-b; cout<<"After swapping, the numbers are: "<<"a = "<<a<<" b = "<<b; }