Wednesday, June 25, 2008

c++

#include
#include
void main()
{
int x,y,*p1,*p2;
void exchange (int,int);
cout<<"/n enter x & y";
cin>>x>>y;
p1=&x;
p2=&y;
cout<<"/n before exchange X="<exchange (p1,p2)
cout<<"/n after exchange x="<<*p1<<"and y=<<*p2;
getch();
}
void exchange (int and p3,int and p4)
{
int temp;
temp=*p3
*p3=*p4
*p4=temp;
return;

No comments: