Computer Science, asked by dwivediarjun69, 2 months ago

explain C++ program of swapping (3marks)​

Answers

Answered by akashrbllps
0

Answer:

#include <iostream>

using namespace std;

int main()

{

   int a = 5, b = 10, temp;

   cout << "Before swapping." << endl;

   cout << "a = " << a << ", b = " << b << endl;

   temp = a;

   a = b;

   b = temp;

   cout << "\nAfter swapping." << endl;

   cout << "a = " << a << ", b = " << b << endl;

   return 0;

}

Similar questions