Computer Science, asked by mdehteshamejaz, 9 hours ago

#include <stdio.h> void main() { int h = 8; int b = h++ + h++ + h++; printf("%d\n", h); } count no of tokens.​

Answers

Answered by pratyushkumarp41
0

Answer:

from the above questions:-

h=8

b= (h++ + h++) + h++

h++ = 8 is store in b then increase by 9

h++= 9 is store in b then increase by 10

output is 17

h++ = 10 is store in b then increase by 11

total = 17 + 10 = 27

h= 11

b=27

Explanation:

if variable h = 8

and we do h++ means (h+1)

then again h++ means ( h+1)

again h++ means (h+1)

we are trying to modify the number three time as per standard it is not possible to modify more than one time of any variable between two sequence point mean (semicolon;) every compiler give different output of this value.

but today advanced compiler give the accuract value.

but turbo C or any older compiler will give different output.

As latest compiler:-

h++ means post increasment

++h means pre increasment

In h++ first we have to store value than increases by 1

In ++h first we have to increase the value by 1 than store

Similar questions