#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 / divakar
ouput :value of x=5
bcoz sqr(x+1)=(x+1*x+1) if u substitute x=2 u will get 5
since '*' is having more priority than '+'
at the of prog if u add prinf("%d",x); u will get 2
bcoz x value is not changed
| Is This Answer Correct ? | 32 Yes | 4 No |
Post New Answer View All Answers
Explain the difference between structs and unions in c?
What is the difference between declaring a variable and defining a variable?
What does printf does?
What is a function in c?
Explain what is the difference between a free-standing and a hosted environment?
What is #define in c?
what is the height of tree if leaf node is at level 3. please explain
What is #include cctype?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
What are qualifiers?
What is a void * in c?
Is null a keyword in c?
What are the features of c language?
Explain why c is faster than c++?
How do I copy files?