#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$
Step 4: Printing
printf("%c", *r); prints character with ASCII $65$.
Hence, the output is:
Correct Answer: (A)
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.