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 is a void pointer? When is a void pointer used?
what is the different bitween abap and abap-hr?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
Difference between macros and inline functions? Can a function be forced as inline?
What is the difference between ++a and a++?
What are the c keywords?
Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.
If the size of int data type is two bytes, what is the range of signed int data type?
When was c language developed?
what do u mean by Direct access files? then can u explain about Direct Access Files?
Can main () be called recursively?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What are file streams?
When is a null pointer used?
Do you know null pointer?