//27-11-2014
//Ahmad Furqan Attari
//p5.8
#include <iostream>
#include <conio.h>
using namespace std;
void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}
void main(void)
{
int a=5, b=8;
cout << "Befor Swap a=" << a << " , b= " << b << endl;
swap(a, b);
cout << "After Swap a=" << a << " ,b= " << b << endl;
_getch();
}
//Ahmad Furqan Attari
//p5.8
#include <iostream>
#include <conio.h>
using namespace std;
void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}
void main(void)
{
int a=5, b=8;
cout << "Befor Swap a=" << a << " , b= " << b << endl;
swap(a, b);
cout << "After Swap a=" << a << " ,b= " << b << endl;
_getch();
}
No comments:
Post a Comment