// This program demonstrates a pointer variable referencing 
// different variable
#include <iostream>
using namespace std;

int main()
{
    int x =25, y = 50, z = 75;      // three int variables
    int *ptr = nullptr;             // pointer variables
    
    // display the contents of x, y, and sizeof
    cout << "Here are the values of x, y, and z:\n";
    cout << x << " " << y << " " << z << endl;
    
    // use the pointer to manipulate x, y, and z
    
    ptr = &x;            // store the address of x in ptr 
    *ptr += 100;         // add 100 to the value in x 
    
    ptr = &y;           // store the address of x in ptr 
    *ptr += 100;        // add 100 to the value in y 
    
    ptr = &z;           // store the address of x in ptr 
    *ptr += 100;        // add 100 to the value in z 
    
    // display the contents of x, y, and z 
    cout << "Once again, here are the values of x, y, and z:\n";
    cout << x << " " << y << " " << z << endl;
    return 0;
    
}