Question 26
What is the output of this code?
#include <stdio.h>
int num = 100;
void modify(void) {
int num = 50;
}
int main(void) {
modify();
printf("%d", num);
return 0;
}Detailed Solution
Inside modify(), local 'num' shadows global 'num'. Modifying local 'num' leaves global 'num' unchanged at 100.