#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?
Answers were Sorted based on User's Feedback
Answer / jugal
The OUTPUT of the program wud be
"value of x=9"
NOTE:
#define sqr(x) (x*x) and
#define sqr(x) x*x
are two very different things
what Divakar and all are saying is referring to the 2nd
one, where as in this case the 1st one is given
Coming to the actual question
The value of x will remain 2, since its value is not being
changed anywhere in the program, its just being passed to a
macro, but NOT modified there either.
Try adding a line at the end of the program
printf("x=%d",x);
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / poorna
Warning: Function Should have return value........
Is This Answer Correct ? | 4 Yes | 5 No |
Eight queens puzzle
What are the types of type specifiers?
What are loops c?
Implement a function that returns the 5th element from the end in a singly linked list of integers in one pass.
What is a macro in c preprocessor?
Was 2000 a leap year?
What is typedf?
create a C program that displays one z,two y's,three x's until twenty six A's. plzz answer i need it tomorrow.
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Tell me what are bitwise shift operators?
How we add our function in liabrary as liabrary function. Exp. we want use our int factorical(int); function as int pow(int,int); function working in math header file.
How do I determine whether a character is numeric, alphabetic, and so on?