#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 is malloc() function?
which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +
What does %p mean?
Why are all header files not declared in every c program?
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
Why does everyone say not to use scanf? What should I use instead?
What do you mean by a local block?
What is the difference between functions abs() and fabs()?
What is #error and use of it?
Write a program to print "hello world" without using a semicolon?
How can I call system when parameters (filenames, etc.) Of the executed command arent known until run time?
Where static variables are stored in memory in c?
Why is C language being considered a middle level language?
What does the characters “r” and “w” mean when writing programs that will make use of files?
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?