What will be the output?
int main()
{
printf("%d", d++);
}
int d = 10;
Answer: D
Correct answer: Compile time error
d is declared after main, so at the point of use it is not in scope. Under C99 and later an undeclared identifier is an error; older compilers would have assumed int and then found the later definition consistent, but the modern answer is a compile error.
Please log in or register to report this question.