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; }

11th Sep 2019, 5:56 AM
Kunika Satija
Kunika Satija - avatar
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);
11th Sep 2019, 6:06 AM
Vijay Meena