Infolinks - Earn Easy Money

Saturday, April 4, 2015

C++ program to swap the values of two integers.

#include <iostream>
using namespace std;
int main (    )
{
int a , b , c ;

cout<<" Value of a is : ";
cin>> a;
cout<<" \n Value of b is : ";
cin>> b;
c=a;
a=b;
b=c;
cout<<" \n Values had been interchanged \n\n";
cout<< " Value of a becomes : " << a << endl;
cout<< " Values of b becomes : " << b << endl;
return 0;
}

No comments:

Post a Comment

Must drop your comments about post.