Feel free to use my code in your programming projects at school or work. If you have some questions please send me an email at jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
People here in the Philippines can reach me at my mobile number 09173084360.
Thank you very much and Happy Programming.
Program Listing
#include <iostream>
using namespace std;
int swap(int *a, int *b)
{
int temp=0;
temp = *a;
*a = *b;
*b = temp;
}
main() {
int a=0,b=0;
cout << "\t\t Swap Two Numbers ";
cout << "\n\n";
cout << "Enter two numbers ==> "; swap(&a,&b);
cout << "\n\n";
cout <<"Swap Arragement ==> "
<< a << " " << b;
cin >> a >> b;
cout << "\n\n";
cout <<"Original Arragement ==> "
<< a << " " << b;
cout << "\n\n";
system("pause");
}
No comments:
Post a Comment