0
What will be the output
#include <stdio.h> int main() { const int* ptr; int* ptr1; int a=10; const int p=20; ptr=a; ptr1=p; printf(ptr); printf(ptr1); return 0; }
2 Answers
0
There will be no output because printf() is not used like this in C language. Another reason is ptr is a pointer type variable that will store address not value.
So it would be better if you use like this-
ptr = &a;
printf ("%d",*ptr);