Pointer MCQs

253 questionsC-ProgramPage 6 of 29

Practice free Pointer multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 253 questions — no login required.

Question 46easy
What will be printed after compiling and running the following code?
main() 
{ 
    char *p; 
    printf("%d %d",sizeof(*p), sizeof(p));
}
Question 47easy
What will be the output of the following program code?
#include <stdio.h>
void main()
{
    int i=3, *j, **k;
    j = &i
    k = &j
    printf("%d%d%d", *j, **k, *(*k));
}
Question 48easy
Which of the following is the correct way of declaring a float pointer:
Advertisement
Question 49easy
Find the output of the following program.
void main()
{
   char *msg = "hi";
   printf(msg);
}
Question 50easy
Find the output of the following program.
void main()
{
   int array[10];
   int *i = &array[2], *j = &array[5];
   int diff = j-i;
   printf("%d", diff);
}
Question 51easy
Find the output of the following program.
void main()
{
   printf("%d, %d", sizeof(int *), sizeof(int **));
}
Advertisement
Question 52easy
Find the output of the following program.
void main()
{
   int i=10;  /* assume address of i is 0x1234ABCD */
   int *ip=&i
   int **ipp=&&i
   printf("%x,%x,%x", &i, ip, *ipp);  
}
Question 53easy
Which of the following statements are true after execution of the program.
void main()
{
   int a[10], i, *p;
   a[0] = 1;
   a[1] = 2;
   p = a;
   (*p)++;
}
Question 54easy
What is the base data type of a pointer variable by which the memory would be allocated to it?