mcqs bucket

  • MCQs Bucket | Program Write a C++ Program to Swap Two Numbers

    mcqsbucket

      Best guide for exams of all nature, Competitive exams and Interviews

Write a C++ Program to Swap Two Numbers

	 
                                 		

#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;
}