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 scanf_s in c?
What is New modifiers?
Explain what math functions are available for integers? For floating point?
Is main a keyword in c?
What is the difference between struct and typedef struct in c?
If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..
List a few unconditional control statement in c.
What is header file definition?
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What is the difference between typedef and #define?
Write the control statements in C language
What is null in c?
Why calloc is better than malloc?
What does a pointer variable always consist of?
write a program to rearrange the array such way that all even elements should come first and next come odd