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
English,
3 months ago
English,
3 months ago
Geography,
3 months ago
Computer Science,
6 months ago
Math,
6 months ago
India Languages,
11 months ago
Math,
11 months ago