Monday 19 August 2013

Lecture 153

Lecture 153

//Procedures and Functions
//Code:
#include <iostream>
#include <conio.h>
using namespace std;
void swapr(int*,int*);  // Prototype
main ()
{
  int a=10,b=20;
  cout <<"\n a =  "<<a<<" b =  "<<b;
  swapr(&a,&b);
  getch();
  return 0;
}
void swapr(int *a,int *b)
{

   int t;
   t=*a;
   *a=*b;
   *b=t;
   cout <<"\n a =  "<<*a<<" b =  "<<*b;
    
}


Output: