write a c++ program to read any two values. Swap them and show the output
Answers
Explanation:
#include <iostream>
#include <iostream>using namespace std;
#include <iostream>using namespace std;int main()
#include <iostream>using namespace std;int main(){
#include <iostream>using namespace std;int main(){ int a = 5, b = 10, temp;
#include <iostream>using namespace std;int main(){ int a = 5, b = 10, temp; cout << "Before swapping." << endl;
#include <iostream>using namespace std;int main(){ int a = 5, b = 10, temp; cout << "Before swapping." << endl; cout << "a = " << a << ", b = " << b << endl;
#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;
#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;
#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;
#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;
#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;
#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;
#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;}
Easy
Explanation:
#include<stdio.h>
#include<iostream.h>
void main(void)
{
int a,b,t;
cout<<" Enter a and b which are to be swapped :";
cin>>a>>b;
t=a;
a=b;
b=t;
cout<<"\nAfter swapping, a and b are "<<a<<"\t"<<b<<" respectively";
return;
}
Don’t hesitate to consult for doubt in the comments below and Don't forget to mark it the brainliest if it helps.. #BAL #answerwithquality