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
*/

0 comments:

Post a Comment

 
 
 
 


Copyright © 2012 http://codeprecisely.blogspot.com. All rights reserved |Term of Use and Policies|