#include<iostream>
using namespace std;

int main()
{
	/*Q1
	
	int a=1, b=2,*ptr;
	ptr=&b;
	cout<<"value of b is "<<b<<endl;
	cout<<"The address of b is "<<&b<<endl;
	cout<<"The value of ptr is "<<ptr<<endl;
	cout<<"The value of *ptr is "<<*ptr<<endl<<endl;
	*/
	
	/*Q2
	
	int 
	a=1,b=2,*ptr=&b;
	a=*ptr;
	cout<<"value of a is "<<a<<endl;
	cout<<"value of b is "<<b<<endl;
	cout<<"The address of a is "<<&a<<endl;
	cout<<"The address of b is "<<&b<<endl;
	cout<<"The value of ptr is "<<ptr<<endl;
	cout<<"The value of *ptr is "<<*ptr<<endl<<endl;
	*/
	
	/*Q3
	
	int a=1,b=2,c=5,*ptr=&c;
	b=*ptr;
	*ptr=a;
	cout<<"value of a is "<<a<<endl;
	cout<<"value of b is "<<b<<endl;
	cout<<"value of c is "<<c<<endl;
	cout<<"The address of a is "<<&a<<endl;
	cout<<"The address of b is "<<&b<<endl;
	cout<<"The address of c is "<<&c<<endl;
	cout<<"The value of ptr is "<<ptr<<endl;
	cout<<"The value of *ptr is "<<*ptr<<endl<<endl;
	*/
	
	//Q4
	
	int a=1,b=2,c=5,*ptr;
	ptr=&c;
	c=b;
	a=*ptr;
	cout<<"value of a is "<<a<<endl;
	cout<<"value of b is "<<b<<endl;
	cout<<"value of c is "<<c<<endl;
	cout<<"The address of a is "<<&a<<endl;
	cout<<"The address of b is "<<&b<<endl;
	cout<<"The address of c is "<<&c<<endl;
	cout<<"The value of ptr is "<<ptr<<endl;
	cout<<"The value of *ptr is "<<*ptr<<endl<<endl;
	
	
	return 0;
	
}
