Saturday 1 November 2014
19. Write a program to print the value and address of the element.
19. Write a program to print the value and address of the element.
PRO-19:
#include<stdio.h>
#include<conio.h>
void main()
{ int
a=20;
float
b=10.25;
int
*ptr;
clrscr();
ptr=&a;
printf("\nThe
value of A = %d and B = %f",
a,b);
printf("\nThe
address of A = %u",ptr);
printf("\nThe
address of B = %u",&b);
printf("\nThe
value of Pointer = %d",*ptr);
getch();
}
OUTPUT:
The value of A =
20 and B = 10.250000
The address of A
= 65524
The address of B
= 65520
The value of
Pointer = 20
|
|
Subscribe to:
Post Comments
(
Atom
)
No comments :
Post a Comment