#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
Explain Function Pointer?
Why should I prototype a function?
What are variables c?
What are types of preprocessor in c?
How can type-insensitive macros be created?
What are the different types of endless loops?
Why is it that not all header files are declared in every C program?
Can a pointer be static?
What is the difference between formatted&unformatted i/o functions?
What does the characters “r” and “w” mean when writing programs that will make use of files?
State the difference between realloc and free.
What is the use of in c?
how to find anagram without using string functions using only loops in c programming
Explain why c is faster than c++?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }