Pointer basic


This program asks the user to enter integers as inputs to be stored in the variables 'a' and 'b' respectively. There are also two integer pointers named ptrA and ptrB. Assign the values of 'a' and 'b' to ptrA and ptrB respectively, and display them Test Case 1 Input (stdin) 1 2 Expected Output Value of ptrA is 1 Value of ptrB is 2 Test Case 2 Input (stdin) 5 6 Expected Output Value of ptrA is 5 Value of ptrB is 6

Program :

#include <iostream>

using namespace std;

int main()


int a,b;


  cout<<"Value of ptrA is "<<a<<endl;

  cout<<"Value of ptrB is "<<b;

return 0;