#define f(x)
main()
{
printf("\n%d",f(2+2));
}
Answers were Sorted based on User's Feedback
Answer / g.j.hemalatha
f(x) is an identifier.No constants is defined in the macro
definition.So the answer is a garbage value.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / priyadarshan kasta
it will show a error message as expression syntax error
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / civa
Compiler Error "error: syntax error before ')' token"
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / suman halder
within printf statement,f(2+2) i.e f(4) must return a value so that this value could get printed through %d format specifier..
Now,as f(x) is a macro template and macro expansion code for this template is not specified..so,here the situation is like,we are trying to return an integer value from a function which is having a "void" return type..
so,compiler flashes "Expression syntax error"..as during preprocessing macro template can't be replaced by macro expansion...
| Is This Answer Correct ? | 0 Yes | 0 No |
write a c program to find biggest of 3 number without relational operator?
write a c program to print "Welcome" without using semicolon in the whole program ??
Why structure is used in c?
What are the 4 data types?
program to find out date after adding 31 days to a date in the month of febraury also consider the leap year
differentiate built-in functions and user – defined functions.
Explain the concept of "dangling pointers" in C.
Is it possible to create recycle bin in mobiles?
Explain the advantages and disadvantages of macros.
i want to know aptitude questions,technical questions
What is the c language function prototype?
How is a null pointer different from a dangling pointer?