QUIZ 36

What will be the output?

#include<stdio.h>
int m=5;
void main()
{
int m=20;
{
int m=10*::m;
printf(“m=%d, ::m=%dn”,m,::m);
}
printf(“m=%d, ::m=%dn”,m,::m);
}

a. m=200, ::m=20
m=20, ::m=5
b. m=50, ::m=5
m=50, ::m=5
c. m=20, ::m=5
m=20, ::m=5
d. m=50, ::m=5
m=20, ::m=5

Answer :(d)

::m refers to the global value assigned i.e. m=5

Leave a Reply

Your email address will not be published. Required fields are marked *