#include<conio.h>
#include<iostream.h>
void main()
{
clrscr() ;
int *x,*y ,a=0,b=1, temp;
x=&a;
y=&b;
temp=*x;
*x=*y;
*y=temp;
cout<<"the value of x and y "<<x<<" " <<y;
cout<<"\nthe value of a and b "<<a<<" "<<b;
cout<<"\nthe value of *x and *y is "<<*x<<" "<<*y;
cout<<"\nthe value of &a and &b is "<<&a<<" "<<&b;
getch();
}
#include<iostream.h>
void main()
{
clrscr() ;
int *x,*y ,a=0,b=1, temp;
x=&a;
y=&b;
temp=*x;
*x=*y;
*y=temp;
cout<<"the value of x and y "<<x<<" " <<y;
cout<<"\nthe value of a and b "<<a<<" "<<b;
cout<<"\nthe value of *x and *y is "<<*x<<" "<<*y;
cout<<"\nthe value of &a and &b is "<<&a<<" "<<&b;
getch();
}
No comments:
Post a Comment