C++ Program To Swap Two Value Using Third variable

C++ Program To Swap Two Value  Using Third variable

/*C++ Program To Swap Two Value Using Third variable*/

#include<iostream>

 using namespace std;

int main()
{ int a,b,temp;
    cout<<"Enter the value Of A:--";
    cin>>a;
    cout<<"Enter The Value Of B:--";
    cin>>b;
    cout<<"Befor Swapping!!!";
    cout<<"\nA:"<<a;
    cout<<"\nB:"<<b;
    temp=a;
    a=b;
    b=temp;
    cout<<"\nAfter Swapping!!!";
    cout<<"\nA:"<<a;
    cout<<"\nB:"<<b;
    return 0;
}

Post a Comment

0 Comments