Discussion
What is the Error of this program?
#include <stdio.h>
#define CONDITION(x)
printf("letsfindcourse");
int main()
{
CONDITION(0);
return 0;
}
Answer: B
Correct answer: Compilation error
CONDITION(x) is defined with an empty body - the macro definition ends at the end of that line. The printf on the next line is therefore not part of the macro at all: it is an ordinary statement sitting at file scope, outside any function, which the compiler rejects. Continuing the definition onto a second line requires a backslash at the end of the first.
No comment is present. Be the first to comment.
Loading…
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development