Computer Science, asked by Madhu123mri, 1 year ago

Write a program to swap two values in C++. (example: 50, 24)


Anonymous: no madu

Answers

Answered by yajatkhanna28p3rjsk
2
Really simple.

Just keep in mind that I'm gonna skip the Header files and assume I'm writing in Turbo C++ .

void main ()
{
int a,b;
cout<<"enter 2 numbers to be swapped";
cin>> a>>b;

int temp; //temporary variable for swapping

temp =a;
a=b;
b=temp;

cout<<a<<b;

} // main

Madhu123mri: thanks
yajatkhanna28p3rjsk: No problem. just follow me and make it the brainliest answer plzz
Similar questions