Find the output of the following program.
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}
#define INC(X) X++
void main()
{
int x=4;
printf("%d", INC(x++));
}
A. 4
B. 5
C. 6
D. Error
Answer: Option D
Solution(By Examveda Team)
L value is required for this expression (x++) which is illegal.
Join The Discussion
Comments ( 3 )
Related Questions on C Preprocessor
What is the purpose of the C preprocessor in C programming?
A. Compile C code
B. Optimize code
C. Preprocess code before compilation
D. Execute code
A. #define
B. #include
C. #ifdef
D. #pragma
What is the purpose of the #define directive in C preprocessing?
A. To include a header file
B. To define a macro
C. To declare a constant
D. To declare a variable
In C, which directive is used to conditionally include code based on preprocessor macros?
A. #ifdef
B. #ifndef
C. #if
D. #else
what is l-value
Check out the L value and R value concept of c program
what L? y?