Skip to content
Related Articles
Open in App
Not now

Related Articles

C Quiz – 109 | Question 5

Improve Article
Save Article
  • Difficulty Level : Basic
  • Last Updated : 28 Jun, 2021
Improve Article
Save Article

Find out the correct statement for the following program.




#include "stdio.h"
  
int * arrPtr[5];
  
int main()
{
 if(*(arrPtr+2) == *(arrPtr+4))
 {
   printf("Equal!");
 }
 else
 {
  printf("Not Equal");
 }
 return 0;
}

(A) Compile Error
(B) It’ll always print Equal.
(C) It’ll always print Not Equal.
(D) Since elements of arrPtr aren’t initialized in the program, it’ll print either Equal or Not Equal.


Answer: (B)

Explanation: Here arrPtr is a global array of pointers to int. It should be noted that global variables such arrPtr are initialized to ZERO. That’s why all are elements of arrPtr are initialized implicitly to ZERO i.e. correct answer is b.

Quiz of this Question

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!