Practical problem 1.b
Write a C++ program to interchange the values of two variables without using a third variable
STARU
Answers
Answered by
0
Answer:
#include <iostream>
using namespace std;
int main()
{
int a,b;
cin>>a;
cin>>b;
cout<<"Value of A & B before changing= "<<a<<" & "<<b<<endl;
a=a+b;
b=a-b;
a=a-b;
cout<<"Value of A & B after changing= "<<a<<" & "<<b;
return 0;
}
Explanation:
Mark as brainliest : )
Similar questions
Political Science,
3 months ago
Math,
3 months ago
History,
3 months ago
Computer Science,
6 months ago
Math,
6 months ago
India Languages,
10 months ago
Math,
10 months ago