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

Correct Answer: 20 40

Explanation:

In case of a conflict between a local variable and global variable, the local variable gets priority.

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion