Declarations and Initializations - Programming

Q1:

What will be the output of the program?
#include<stdio.h>
int X=40;
int main()
{
    int X=20;
    printf('%d\n', X);
    return 0;
}

A 20

B 40

C Error

D No Output

ANS:A - 20

Whenever there is conflict between a local variable and global variable, the local variable gets priority.