GeeksforGeeks » Interview Questions
Interview Question for Software Engineer/Developer (Fresher) about CPuzzles
(3 posts)-
int main() { #ifdef TRUE /* Error? int a; a = 10; #else int a; a = 20; #endif printf("%d",a); return 0; }a) 20
b) 10
c) Error because unterminated comment
d) Error since preprocessor directives must precede all declarations -
d) Error since preprocessor directives must precede all declarations
-
c)
Code below third line is treat as a comment, so compile code is
int main()
{
#ifdef TRUE
Reply
You must log in to post.