#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 #ifdef ? What is its application?
What is ambagious result in C? explain with an example.
Is c is a high level language?
What is nested structure with example?
What does p mean in physics?
Is main is a keyword in c?
Explain how can I convert a number to a string?
What is the difference between NULL and NUL?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
Explain the red-black trees?
What is c token?
application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above
Is there any possibility to create customized header file with c programming language?
Which header file should you include if you are to develop a function which can accept variable number of arguments?