9. (A) Write a program to demonstrate the use of pointers.
#include <stdio.h> | |
int main(){ | |
int* pc; | |
int c; | |
c=22; | |
printf("Address of c:%u\n",&c); | |
printf("Value of c:%d\n\n",c); | |
pc=&c; | |
printf("Address of pointer pc:%u\n",pc); | |
printf("Content of pointer pc:%d\n\n",*pc); | |
c=11; | |
printf("Address of pointer pc:%u\n",pc); | |
printf("Content of pointer pc:%d\n\n",*pc); | |
*pc=2; | |
printf("Address of c:%u\n",&c); | |
printf("Value of c:%d\n\n",c); | |
return 0; | |
} |
9. (A) Write a program to demonstrate the use of pointers.
Reviewed by admin
on
December 23, 2019
Rating:

No comments: