Posts

Showing posts with the label OOT ( Object Oriented Technology) Lab Practical

OOT ( Object Oriented Technology) Lab Practical

Image
1)Call By value #include< conio.h > #include< iostream.h > void swap( int   a, int b) { int t=a; a=b; b=t; cout <<"after swap the value of no."<<m<<n; } void main() { clrscr (); int m,n ; cout <<"enter any 2 no."; cin >>m>>n; swap(& m,&n ); cout <<"after swap the value of no."<<m<<n; getch (); } 2)Call by Reference #include< conio.h > #include< iostream.h > void swap( int &a, int &b) { int t=a; a=b; b=t; } void main() { clrscr (); int m,n ; cout <<"enter any 2 no."; cin >>m>>n; swap( m,n ); cout <<"after swap the value of no."<<m<<n; getch (); } 3) Call by Pointer    # include< conio.h > #include< iostream.h > void swap( int *a, int *b) { int t=*a; *a=*b; *b=t; } void main() { clrscr (); int m,n ; cout <<"enter any 2 no."; cin >>m>>n; swap(& m,&n ...