Computer Science, asked by manjunatha71157, 6 months ago

Practical problem 1.b
Write a C++ program to interchange the values of two variables without using a third variable
STARU
vedio \: of \: this \: question \\

Answers

Answered by rahmanbinjaffar
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