Q. Determine Output

Code:
#include<stdio.h>
#define a 10
void main()
{
      #define a 50
      printf("%d", a);
}
  • (A) 50
  • (B) 10
  • (C) Comiler error
  • (D) None of these
πŸ’¬ Discuss
βœ… Correct Answer: (A) 50
Explanation: The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.
Explanation by: Rajeev Malhotra
The preprocessor directives can be redefined anywhere in the program. So the most recently assigned value will be taken.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
339
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rajeev Malhotra
Publisher
πŸ“ˆ
91%
Success Rate