Documente Academic
Documente Profesional
Documente Cultură
c) d)
#include<stdio.h>
main() #include<stdio.h>
{ main()
int x=30, *y, *z ; {
y= &x ; int ***r, **q, *p, i=8 ;
/* Assume address of x is 500 and integer is 4 byte p = &i ;
size */ q = &p ;
r = &q ;
z = y; printf("%d, %d, %d\n", *p, **q, ***r);
*y++ = *z++ ; }
x++ ;
printf("x=%d, y=%d, z=%d\n", x, y, z);
}
e) f)
#include<stdio.h> #include<stdio.h>
main( ) main()
{ {
float a = 13.5 ; int i = 5 , j ;
float *b, *c ; int *p , *q ;
b = &a ; /* suppose address of a is 1006 */ p = &i ;
c=b; q = &j ;
printf ( "\n%u %u %u", &a, b, c ) ; j=5;
printf ( "\n%f %f %f %f %f", a, *(&a), *&a, *b, *c ) ; printf("%d %d", *p,*q) ;
} }
1
2. C program to print size of different types of pointer variables.
Hint:- Output depends on the system architecture, but each type of pointer will take
same memory space.
5. Program to read array elements and print with addresses using pointer.