#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 |
difference between c and c++
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What is a good way to implement complex numbers in c?
Where local variables are stored in c?
compute the nth mumber in the fibonacci sequence?
10 Answers Canon, HPL, Satyam, TCS,
#include<stdio.h> int main( ) { Int a=300, b, c; if(a>=400) b=300; c=200; printf(“%d%d ”, b, c); return0; }
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
write a c program to find the roots of a quadratic equation ax2 + bx + c = 0
11 Answers CSC, St Marys, TATA,
Explain demand paging.
What does %c do in c?
Give the Output : * * * * * * * * * *
Do you have any idea how to compare array with pointer in c?