#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 |
Hierarchy decides which operator a) is most important b) is used first c) is fastest d) operates on largest numbers
Hai what is the different types of versions and their differences
What is a structural principle?
Who developed c language and when?
What is meant by preprocessor in c?
Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.
Is there a built-in function in C that can be used for sorting data?
consider the following C code main() { int i=3,x; while(i>0) { x=func(i); i--; } int func(int n) { static sum=0; sum=sum+n; return(sum); } the final value of x is
Describe static function with its usage?
Explain heap and queue.
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
what is the importance of spanning tree?