Pointers Questions and Answers
Practice ModeShowing 10 of 217 questions
Q171
Which of the following statement is true ?
Answer: Option D
Q172
Find the output.
void main ()
{
int *p;
const int i=10;
p=&i;
printf "%d %d", *p, ++*p);
}
Answer: Option B
Q173
Find the output
void main ( )
int *p;
float a[5];
for (p=a; p<&a [5]; p++)
{
*p=p-a;
printf("%d", *p);
}
}
Answer: Option B
Q174
Find the output
void main ( )
{
char *p="abc123", *q="abc";
while *p++=*q++)
printf("%c%c", *p,*q);
}
Answer: Option C
Q175
Find the output
#include "stdio.h"
void main ( )
char *const fp);
char *const ptr;
ptr=fp( );
printf ("\n %s", ptr);
}
char *const fp( )
{
return "MAGIC";
}
Answer: Option C
Q176
Find the output
int a[ ] = {1, 2, 3, 4, 5}:
void main ( )
{
int *p, *q, i;
p=a;
q=a+2;
i=*p++;
printf("%d %d", i, q-p);
}
Answer: Option A
Q177
Find the output
void main ( )
{
int *p [ ] = {1, 45, 78, 100};
printf("%d", sizeof (p) / sizeof (int*));
}
Answer: Option B
Q178
Find the output
void main ( )
{
char *p="Tuni";
reverse (p);
printf("%s",p);
}
reverse (char *q)
{
char *r="Hello";
q=r;
printf("&s", q);
}
Answer: Option C
Q179
Find the output
void main ( )
{
const char *p="CIMPLE";
p++;
*p='a';
printf("%s",p);
}
Answer: Option C
Q180
Find the output
void fun (int *a,int *b)
{
int *t;
t=a, a=b, b=a;
printf("%d %d", 8a, *b);
}
void main ( )
{
int a=3;
void fun ( );
int b=5;
fun (&a, &b);
}
Answer: Option C