what is the value of b
if a=5;
b=++a + ++a
Answer Posted / naresh
Not a very tough question. Important thing to note that in
any expression pre increment operator has a higher prority
than arithemetic operator as a result value of a is
increment is first two times then value of b is evaluated.
So b = 7*7 = 14.
in first ++a we get a=6
in next ++a we get a=7
and b=7+7=14
This question will result in same output for most of the
compilers, but some rare compiler may produce an entire
diffrenent parse tree resulting in an undefined result
| Is This Answer Correct ? | 28 Yes | 13 No |
Post New Answer View All Answers
What are global variables and explain how do you declare them?
What are header files and explain what are its uses in c programming?
What are 3 types of structures?
program to find error in linklist.(i.e find whether any node point wrongly to previous nodes instead of next node)
What is the use of a static variable in c?
What is "Duff's Device"?
How many parameters should a function have?
Explain what header files do I need in order to define the standard library functions I use?
What is bubble sort technique in c?
How can I write functions that take a variable number of arguments?
Can we assign integer value to char in c?
What is a structural principle?
Why we use break in c?
Why is c so popular?
please send me the code for multiplying sparse matrix using c