what is the value of b
if a=5;
b=++a + ++a

Answers were Sorted based on User's Feedback



what is the value of b if a=5; b=++a + ++a ..

Answer / ashfak yeafi

The answer is 14.
The increment operator has a higher priority than the arithmetic operator.
So the equation will be,
b=7+7=14

Is This Answer Correct ?    0 Yes 0 No

what is the value of b if a=5; b=++a + ++a ..

Answer / vinit kumar

answer would be 14

because value will be stored in cpu register..

b=7+6

last vale is 7 then it increases two times so 7*2=14

Is This Answer Correct ?    5 Yes 6 No

what is the value of b if a=5; b=++a + ++a ..

Answer / goldy ramnani

13
because 1stly a=5,
then compiler compile fromleft to right,
so ++a means a=6 then
++a a=6 now a=7,lastly 7+6=13

Is This Answer Correct ?    1 Yes 2 No

what is the value of b if a=5; b=++a + ++a ..

Answer / naga

Ans:13

Is This Answer Correct ?    0 Yes 1 No

what is the value of b if a=5; b=++a + ++a ..

Answer / pawan patil

it's very simple that value of b=13
because the actual value of a=5 then
b=++a + ++a
b=(6) + (++6)= 12
b= (6) + (7)=13
then b=13

Is This Answer Correct ?    0 Yes 2 No

what is the value of b if a=5; b=++a + ++a ..

Answer / sasmita

Depending upon Compiler it will b 13 or 14.In Unix its 13.

Is This Answer Correct ?    4 Yes 8 No

what is the value of b if a=5; b=++a + ++a ..

Answer / nitin jatpuriya

14

Is This Answer Correct ?    15 Yes 22 No

what is the value of b if a=5; b=++a + ++a ..

Answer / sas

cn u tl me detail how?14

Is This Answer Correct ?    3 Yes 10 No

what is the value of b if a=5; b=++a + ++a ..

Answer / pravesh

a=5
b=++a(6) + ++a(7)
b=13+1 when last addition is performed.
so, b=14

Is This Answer Correct ?    1 Yes 18 No

what is the value of b if a=5; b=++a + ++a ..

Answer / manikandans

12

Is This Answer Correct ?    5 Yes 23 No

Post New Answer

More C Interview Questions

int x=sizeof(!5.856); What will value of variable x?

2 Answers  


write a reverse string to print a stars.(with out using logic) ***** **** *** ** *

2 Answers  


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

0 Answers  


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings

0 Answers  


How can I pad a string to a known length?

0 Answers  






how to swap 2 numbers within a single statement?

4 Answers  


Who had beaten up hooligan "CHAKULI" in his early college days?

1 Answers  


What are the usage of pointer in c?

0 Answers  


#define MAX 3 main() { printf("MAX = %d \n",MAX ); #undef MAX #ifdef MAX printf("Vector Instituteā€); #endif

4 Answers   IBM, Vector,


Describe the steps to insert data into a singly linked list.

0 Answers  


HOW TO FIND OUT THE RREVERS OF A GIVEN DIGIT NUMBER IF IT IS INPUT THROUGH THE KEYBORD BY USING C LANGUAGE

3 Answers   Wipro,


Why we use break in c?

0 Answers  


Categories