#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
What are void pointers in c?
Explain the difference between call by value and call by reference in c language?
Why isn't any of this standardized in c? Any real program has to do some of these things.
What is difference between Structure and Unions?
please send me the code for multiplying sparse matrix using c
What are inbuilt functions in c?
What is a structure member in c?
What is the difference between array and pointer in c?
How is a pointer variable declared?
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
How can a program be made to print the name of a source file where an error occurs?
How can I generate floating-point random numbers?
What is indirection in c?
Why is void main used?
When is a void pointer used?