C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - Find Output of Program (Q.No. 6)
6.
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;
}
Answer: Option
Explanation:
Whenever there is conflict between a local variable and global variable, the local variable gets priority.
Discussion:
21 comments Page 3 of 3.
Harish said:
1 decade ago
Exactly how can I access the local and global variable, what is the variables concept?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers