C - Write program to display int variable via its pointer

Requirements

Write a program that declares both an int variable and an int pointer variable.

Use the pointer variable to display the value stored by the int variable.

Demo

#include <stdio.h>

int main()/*w  w w  .  j a  v  a 2s. c  om*/
{
    int i = 1814;
    int *pi = &i;

    printf("The value of 'i' is %d.\n",*pi);
    return(0);
}

Result

Related Example