Program to print value and address of a variable


#include <iostream.h>
#include<conio.h>
void main()
{
    int i=5;
    clrscr();
    cout<<"Value of i : "<<i<<"\n";
    cout<<"Address of i : "<<&i;
    getch();
}
/*
Sample input and output
Value of i : 5
Address of i : 0x8fc5fff4
*/

No comments:

Post a Comment