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()/*from  w  w w . ja  v  a 2s.  c  o m*/
{
    int i = 1814;
    int *pi = &i;

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

Result

Related Example