🔹 India's Most Trusted MCA Coaching 💻 Live + Recorded Classes | 👨🏫 Expert Faculty 📝 All India Test Series | 🎯 Personal Mentorship 🥈 NIMCET AIR 2: Ayush Garg
#include <stdio.h> main() { int x = 65, *p = &x; void *q = p; char *r = q; printf("%c", *r); }
$x = 65$ In ASCII, $65 \equiv A$
Step 2: Pointer flow $p = \&x \;\; \rightarrow$ pointer to integer $q = p \;\; \rightarrow$ void pointer $r = q \;\; \rightarrow$ typecast to char pointer
Step 3: Dereferencing Since r is char*, it reads 1 byte. The value stored = $65$
r
char*
Step 4: Printing printf("%c", *r); prints character with ASCII $65$. Hence, the output is:
printf("%c", *r);
Correct Answer: (A)
Aspire Study Online Test Series, Information About Examination, Syllabus, Notificationand More.
Get MCA test series, questions & instant updates!
Are you sure to delete this comment?