Pointers Questions and Answers
Practice ModeShowing 10 of 217 questions
Q161
Find the output
void main ( )
{
int x=5, *p,q;
p=&x;
q=p;
printf ("%d", ++*q);
}
Answer: Option C
Q162
Find the output
void main ()
{
char *p=(char*) 0x21;
printf("%d %p", p, p);
}
Answer: Option C
Q163
The following declaration represents
float *p( ) ) ( ) ;
Answer: Option C
Q164
Find the output
void main ( )
{ *(char*) 65 = 'a';
printf ("%c", * (char*) 65);
}
Answer: Option A
Q165
Find the output
void main ( )
{
char *p="com\0";
char *q="comd";
if (p==q)
printf ("both are equal");
else
printf ("not equal");
}
Answer: Option B
Q166
Find the output.
void main ( )
{
char *p="raja";
char *q="ram";
char s[10];
strcpy (s, p, q);
printf("%s", s);
}
Answer: Option A
Q167
Find the output.
void main ( )
{
float *f;
printf ("%D %d",
sizeof (f), sizeof (*f));
}
Answer: Option A
Q168
Find the output
void main ( )
{
char *p={1234};
int *q;
q=p;
while (*p)
{
printf ("%c",, *q);
p++;
q++;
}
}
Answer: Option C
Q169
Find the output
void main ( )
{
char *p="hello";
printf ("%. 3s",p);
}
Answer: Option A
Q170
Find the output.
void main ( )
{
int x=5;
void *p;
p=&x;
printf ("d", *(int *)p);
}
Answer: Option A