Loading, please wait...

Pointers in C Programming MCQ (Multiple Choice Questions And Answers)

Search here for MCQs

Are you preparing for the next job interviews? If yes, trust me this post will help you also we'll suggest you check out a big collection for Programming Full Forms that may help you in your interview:

List of Programming Full Forms 

21. calloc(m, n); is equivalent to

  • ptr = malloc(m*n); strcpy(p, u);
  • memset(0, m*n);
  • ptr = malloc (m*n); memset (p, 0, m*n);
  • All of the above

22. Which of the following comments about arrays and pointers is/are not true?

  • Both are exactly same
  • Array is a constant pointer
  • Pointer is an one-dimensional and dynamic array
  • None of the these

23. Predict the Output of the following code:

#include <stdio.h>
    void main()
    {
        char *a[10] = {"hi", "hello", "how"};
        printf("%d\n", sizeof(a));
    }
  • 30
  • 40
  • 20
  • 10

24. What will be the output of the following program:

void main()
{
int k = 5;
int *p = &k;
int **m = &p;
**m = 6;
printf("%d\n", k);
}
  • 4
  • 7
  • 6
  • Compilation error

25. Guess the output

#include <stdio.h>
    void main()
    {
        char *a[10] = {"hi", "hello", "how"};
        printf(
  • 6
  • 4
  • 1
  • 5