Question
#include<stdio.h>
int main()
{
int x = 40;
{
int x = 20;
printf("%d", x);
}
printf("%d\n",x);
return 0;
What will be the output of the program?
#include<stdio.h>
int main()
{
int x = 40;
{
int x = 20;
printf("%d", x);
}
printf("%d\n",x);
return 0;
Answer: Option B
Was this answer helpful ?
In case of a conflict between a local variable and global variable,
the local variable gets priority.
Was this answer helpful ?
Submit Solution