MasterofProject

2 Cai Niao fat Fat_cai_niao23:52 2015.10.23 questions

Two stage... C language... Ask God

B final output why is equal to 4... Think through... Ask god.. Tomorrow is the two test... Urgent...Picture

67 answers

Wwwsssaaaddd
Wwwsssaaaddd   00:43 2015.10.24
Adopted

The key lies in the conditional expression: (++a < 0) & & (b-- <=0)!
++a + +, in front of the A, then (++a < 0) a is incremented by 1 after 0 is to compare the size, the result is 0 < 0 = false.
The left side of this expression is false, regardless of the right is the result of the entire expression will not affect the results, this situation will not be executed on the right, so B is still the initial value of 4.

U012505618
U012505618   00:13 2015.10.24

Because it is b-- ah, the program is a step by step, in that line of code, the value of B is the same, and then be output
But ++a is a variable.

U012505618
U012505618 Cxlovu: I found out that I was wrong. More right downstairs
27 days ago Reply
Caozhy
Caozhy   Ds   Rxr 00:17 2015.10.24

Because the condition is false & & front
B-- is not executed.

Lanmushan
Lanmushan   00:43 2015.10.24

4 yes, to judge the left is true, to judge the right, if the left is false, then the right of the program will not judge!

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:06 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:06 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:05 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:05 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:06 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Jghtrlhjdghtjgut
Jghtrlhjdghtjgut   05:05 2015.10.24

Return to the kitchen menu, ordering the queue, using a mobile phone is applauded, queuing how to achieve?

Total 67 data One Three Four ... Shadowe
User default icon Csdn
Upload...
Upload pictures
Insert picture