Computer Science, asked by Anonymous, 8 months ago

a=(a>=180)?a++:++a; tell the output where a= 200​

Answers

Answered by manthansarkar1983
0

Answer:

Different compilers will behave differently:

For example, your code results are the following in these compilers:

gcc: 12 12 10

clang: 10 11 11

vc: 11 11 10

Avoid these type of operations in a single line. You can store them in variables or just do the steps one by one.

It's worth noting that these type of issues (compiler dependency) are unique to C/C++. You can easily do such stuff in Java, C# and the results will be always consistent.

Answered by tofailahmad379
1

Answer:

a=(a>=180)?a++:++a; tell the output where a= 200

If a=200

In that equation a++ and ++a are the output

If a>=180 the output will a++ (for true condition)

If a<180 the output will be ++a (for false condition)

So a=200>180

The output will be a++=201 but due to post incrementing put the previous value of a which is 200

So

Output will be 200

Similar questions