#include <stdio.h>
#define sqr(x) (x*x)
int main()
{
int x=2;
printf("value of x=%d",sqr(x+1));
}
What is the value of x?
Answer Posted / fazlur
Macro will blindly substitutes, it doesn't calculate. So
remember whenever you encounter the macro, you first
substitute the value then calculate later. Ofcourse the
answer would be 5 in this case.
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are the string functions? List some string functions available in c.
What is a scope resolution operator in c?
Why we use break in c?
Apart from dennis ritchie who the other person who contributed in design of c language.
What is c system32 taskhostw exe?
How can this be legal c?
What Is The Difference Between Null And Void Pointer?
Why cant I open a file by its explicit path?
while loop contains parts a) initialisation, evalution of an expression,increment /decrement b) initialisation, increment/decrement c) condition evalution d) none of the above
Is void a keyword in c?
Explain which of the following operators is incorrect and why? ( >=, <=, <>, ==)
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }
What is meant by operator precedence?
Explain how does flowchart help in writing a program?
If fflush wont work, what can I use to flush input?