Delicious Digg Facebook Favorites More Stumbleupon Twitter

Monday 8 October 2012

check addresses are correct or not


    /* cosider 3 variables and find the addresses ,first two variables
        addresses difference is equal to another two variables  
        addresses  difference. */

#include<stdio.h>
main()
{
int x=10,y=20,z=30;
clrscr();
printf("address of x=%d\n",&x);
printf("value of x=%d\n",x);
printf("address of y=%d\n",&y);
printf("value of y=%d\n",y);
printf("address of z=%d\n",&z);
printf("value of z=%d\n",z);
getch();
}

output :-
address of x= -12
value of x= 10
address of y= -14                       
value of y= 20
address of z= -16
value of z= 30



0 comments:

Post a Comment