#include <iostream>
using namespace std;

int main()
{
	{
		//Q1
		double x=15.6 , y=10.2 , *ptr_1=&y , *ptr_2=&x;
		*ptr_1=*ptr_2+x;
		cout<<"For question 1 :\n";
		cout<<"The value of ptr_1 is "<<*ptr_1;
		cout<<" and the value of ptr_2 is "<<*ptr_2<<endl;
	}
	
	{
		//Q2
		int w=10,x=2,*ptr_2=&x;
		*ptr_2 -= w;
		cout<<"\nFor question 2 : \n";
		cout<<"The value of ptr_2 is "<<*ptr_2<<endl;
	}
	
	{
		//Q3
		int x[5]={2,4,6,8,3};
		int *ptr_1=NULL , *ptr_2=NULL , *ptr_3=NULL;
		ptr_3=&x[0];
		ptr_1=ptr_2=ptr_3 + 2;   //increase 2 distance = x[2]
		cout<<"\nFor question 3 : \n";
		cout<<"The value of ptr_1 is "<<*ptr_1<<endl;
		cout<<"The value of ptr_2 is "<<*ptr_2<<endl;
		cout<<"The value of ptr_3 is "<<*ptr_3<<endl;
	}
	
	{
		int w[4] ,*first_ptr=NULL , *last_ptr=NULL;
		first_ptr = &w[0];
		last_ptr = first_ptr + 3;
		cout<<"\nFor question 4 : \n";
		cout<<"The address of first_ptr is "<<first_ptr<<endl;
		cout<<"The address of last_ptr is "<<last_ptr<<endl;
		
	}



}
