Pages

Monday, 21 May 2012

program to find memory veriable by using pointer


112./ Write a program to find memory veriable by using pointer*/

#include<stdio.h>
#include<conio.h>
void main()
{
            int x=10,y=20;
            char a='y',b='n';
            float p=90.76,q=75.43;
            clrscr();
            printf("\n%d is stored at address %u",x,&x);
            printf("\n%d is stored at address %u",y,&y);
            printf("\n%c is stored at address %u",a,&a);
            printf("\n%c is stored at address %u",b,&b);
            printf("\n%f is stored at address %u",p,&p);
            printf("\n%f is stored at address %u",q,&q);
            getch();
}

OUTPUT
            10 is stored at address 65524
            20 is stored at address 65522
            y is stored at address 65521
            n is stored at address 65520
            90.760002 is stored at address 65516

No comments:

Post a Comment