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

A set of N billiard balls are set on a one-dimensional table. The table is 1 meter long, set north-south with two pockets at either side. Each ball has zero width and there is no friction so it is moving with a fixed velocity of either northward or southward and bounces back in a perfect elastic collision from other balls it encounter on its way (or drop into one of the pockets). Your job is to keep track of the balls movements. Task Please write a program that gets the initial place, speed and direction of all the balls and gives the position of a specific ball after t seconds. Input The first line contains the number of scenarios. Each one of the other lines in the input contains a scenario: The first number, N, is the number of balls; followed by N pairs of numbers: the distance in centimeters from the south end of the table and the speed (positive speed meaning it moves northward); the last two numbers are the number i of the target ball you should track and the time T in seconds. Output The output is a single number for each line which is the place (distance in centimeters from the south end of the table) of the tracked ball after T seconds. Note: There is no new line character at the end of the result. Sample Input 5 1 50 1 1 1000 1 50 1 1 6 1 60 -2 1 6 2 10 1 95 -1 2 30 2 10 1 95 -1 2 60 Sample Output 100 56 48 65 70

0 Answers  


What is c language & why it is used?

0 Answers  


Are the outer parentheses in return statements really optional?

0 Answers  


coding for Fibonacci.?

1 Answers  


Explain is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?

0 Answers  






What is the sizeof () operator?

0 Answers  


main() { printf(5+"Vidyarthi Computers"); }

6 Answers  


What's the total generic pointer type?

0 Answers  


Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

0 Answers  


please explain every phase in the "SDLC" in the dotnet.

0 Answers  


What is signed and unsigned?

0 Answers  


What are the storage classes in C?

0 Answers  


Categories