C Programming :: Declarations and Initializations - Discussion
Home > C Programming > Declarations and Initializations > MCQs Questions Discussion
4 / 54
What is the output of the following 'C' program?
#include<stdio.h>
#define max
int main(){
printf("%d",max);
return 0;
}
#include<stdio.h>
#define max
int main(){
printf("%d",max);
return 0;
}
A0
Bnull
CGarbage
DCompilation error
E-1
Answer: Option (Login/Signup)
Show Explanation
Asked In ::
STEP-BY-STEP
The correct answer is option D. Here in line 2, there is a syntactical error, as in C, the correct way for defining a constant is #define var value. This 'value' assigned to 'var' will be treated as a constant.
Read Full Answer
Report Error
Please Login First Click Here
STEP-BY-STEP
#define max(a,b) ((a).(b)?(a):(b)) This is the complete and correct way to define the function max . In the code its incomplete hence it shows compiler error.
Read Full Answer
Report Error
Please Login First Click Here