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   www  .j  av a 2  s .c om*/
{
    int i = 1814;
    int *pi = &i;

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

Result

Related Example