What is the Output of below code. | CPP MCQs

int a = 10;
void main()
{
int a = 20;
cout << a << ::a;
}
The output of this program is
A.     Syntax error
B.     10 20
C.     20 10
D.     20 20

Ans: C

1 comments:

sagar said...

it takes global value due to :: operator

Post a Comment

Blogger news