What does c language b 0 mean

Updated on technology 2024-03-22
25 answers
  1. Anonymous users2024-02-07

    First of all, b++ means to do a self-additive operation on b, we use c instead, c=b++;

    Then, a+=b++

    Amount. a+=c, that is, a=a+c, that is to say, the part before "==" is assigned to a, and d is used instead, that is, d=a+c;

    Finally, there is a logical judgment d==0, that is, to determine whether the previously calculated a is equal to 0

    It should be noted that it is b++, not ++b, that is to say, b does not add itself when the current judgment is made, but only adds 1 after the current judgment is executed

    For example, the initial a=1, b=2, b does not add itself, a=a+b=1+2=3, then this sentence is judging "3==0", and the next time it is judged, b will add itself to become 2, a=a+b=3+2=5, which is equivalent to judging "5==0", and so on.

  2. Anonymous users2024-02-06

    This is a combination of two operations into one statement.

    This is also one of the features of the C language.

    Indicates a self-subtracting operation, that is, the value of b after execution is reduced by one compared with the original, which is equivalent to.

    b=b-1;

    When --is behind the variable, do other operations on the value of b first, and then perform self-reduction.

    In this problem, it is to judge b<0 first

    Then perform self-reduction.

    For example, this **:

    int main()

    int b = 0;Define b and initialize to 10if(b--<0)printf("b=%d", b);First judgment.

    printf("%d", b);output bif(b--<0)printf("b = %d", b);Second judgment.

    printf("%d", b);output breturn 0 again;

    For this program, the analysis is as follows:

    b The initial value is 0;

    When executing the first judgment, first judge b<0 and it is not true, and then execute --, b value is -1;

    Since the first judgment is not true, the output will not be executed when the first judgment is made;

    After that, the first output b will be executed, and the value of output b will be -1;

    The second judgment is executed, and the b value is -1, which is less than 0 to hold;

    After executing the judgment, b will self-subtract again, and the value of b is -2;

    The output when the second judgment is executed, the output is b=-2;

    The execution outputs b again with a value of -2.

    In summary, the final output will be:

    b = -2

  3. Anonymous users2024-02-05

    b is a backspace, press the backspace key on the keyboard, it is also a character, but when it is displayed, it will return the cursor to the previous character, but it will not delete the character at the cursor position, if there is a new character after it, it will overwrite the returned character, which is not the same as the effect of pressing backspace in the text editor.

    backslash b(b) in c (you can remove a character from the output that you just output). For example: printf("abcde");printf("\babcd");, the actual output is abcdabcd (the A of the later output overwrites E).

    c The problem of backslash and slash escaping character paths

    In c is an escape character, which escapes only one character after it, and in some special cases, it needs to be used in pairs. Some specific uses of escape characters are as follows:

    For example, if you want to output this string, you might write @ like this"

    But the compiler doesn't let it go through this way, but as you can see in the table above, you can write it like this"\

    In addition, when getting the file path, many people like to use d: ; Then the so-called escape character error occurs, and the solution is to use @d: I don't know if this is a problem.

    The above content reference: Encyclopedia - backslash.

  4. Anonymous users2024-02-04

    In ++b, ++ is called pre-self-additive.

    In b++, ++ is called post-self-additive.

    The calculation effect is all operands plus one.

    It doesn't make a difference when it's a single statement, if it's used in an expression:

    b++ is to take the value of b for calculation first, and then add itself;

    b is added first, and then the value of b is taken for calculation.

    For example, int b = 2, j;

    if j = b++;

    Then first take the value of b and assign it to j, so the value of j is 2, and the value of b is added by itself, b=3.

    if j = b++;

    Then b is added first to get b = 3, and then the b value is taken to calculate, and the j value is 3

  5. Anonymous users2024-02-03

    The difference in the order of operations, if it is just a single sentence, such as b++; or ++b; Then it's the same.

    But if it's in other expressions, wondering b++ is to bring in the equation with b to do the operation, and then b=b+1;

    And ++b, in this case b=b+1;Then put the new b into the equation and calculate.

  6. Anonymous users2024-02-02

    b++ is self-incrementing, ++b is not known.

  7. Anonymous users2024-02-01

    Don't write like this, write the program like this without reporting errors, but the effect of the execution is not to judge that B is between A and C, but to compare the result of A and B (true or false) with C.

  8. Anonymous users2024-01-31

    += is a composite operator. This sentence means b=b+a; Note that there is no space in the middle of +=.

  9. Anonymous users2024-01-30

    First of all, b++ means to do a self-additive operation on b, we use c instead, c=b++;

    Then, a+=b++ is equal to a+=c, that is, a=a+c, that is, the part before "==" is assigned to a, and we replace it with d, that is, d=a+c;

    Finally, there is a logical judgment d==0, that is, to determine whether the previously calculated a is equal to 0

    One thing to note here is b++, not ++b, that is, b does not add itself when the current judgment is made, but only adds 1 after the current judgment is executed

    For example, the initial a=1, b=2, b does not add itself, a=a+b=1+2=3, then this sentence is judging "3==0", and the next time it is judged, b will add itself to become 2, a=a+b=3+2=5, which is equivalent to judging "5==0", and so on.

  10. Anonymous users2024-01-29

    Inside this parenthesis is the comma operator, and the value of its expression is the value of the last expression, which I can also write like this.

    7+b;b++;

    f=a+7;

  11. Anonymous users2024-01-28

    In fact, it is the abbreviation of a=a+b++==0; From the priority of the operator, it can be seen that ++ is the highest, + is second, == again, and = is the lowest, that is, the b++ operation is performed first, the a+(b++) operation is performed, and the a+(b++)==0 operation is carried out, and the result of the most total bar a+(b++)==0 is assigned to a. This can be programmed to be positive.

  12. Anonymous users2024-01-27

    = is a compound assignment operator unique to c c, which is actually an abbreviated form that makes the change of variables more concise, b = a is originally b=b a. = is an assignment not equal. Composite assignment operators are as follows:

    Additive assignment, -= subtraction assignment, *=multiplication assignment, = division assignment, %=modulo assignment, <<=left-shift assignment, >>=right-shifting assignment, &=bit-logical "and" assignment, |= bit-logical "or" assignment, = bit-logical XOR assignment. The difference between b=b a and b=a is that the former expression a is evaluated twice, and the later expression a is only evaluated once, which has little effect on the program running, but with the ordinary assignment operator, when the expression is used as the return value of the function, the function will be called twice, which will increase the overhead of the program and make it less efficient.

  13. Anonymous users2024-01-26

    A++ is the value of a that increments by 1 after a participates in the operation.

    a is a self-incrementing 1 and then participating in other operations.

    Indicates that it is not equal to.

    Example: For the following, there is int x = 5, y = 6, z; z = ++x + y++;

    The trick used is to convert the original calculation into multiple, sequential and small calculations, and then bring in the values of the variables to solve them. Remember: operators with the same priority are evaluated from right to left.

    z = ++x + y++;Can be converted to:

    x = x +1;

    z = x + y;

    y = y + 1;

    Bring in x = 5, y = 6 to get x = 6; z = 12; y = 7;

  14. Anonymous users2024-01-25

    First of all, you need to understand what an expression is, and what variables are.

    A is a variable.

    A++, a is a plus 1

    For example, if a is 1 and a++ or ++a is executed, the value of the a variable is 2.

    As for the difference between a++ and ++a, the difference is mainly in the expression.

    A is the first to perform a plus 1 and then participate in the calculation of the expression.

    a++ means that a participates in the calculation of the expression first, and then executes self-plus 1

    For example: int a, b;

    a=1;If you want to take A's value 1, pay BWell, but you want to make a plus 1. That's what you can do.

    b=a++;++ After a, pay the value of a to b and then add 1 to itself. At this time, b=1, a=2.

    If you don't understand it yet. b=a++;It means b=a; a=a+1;The meaning of these two sentences.

    And b=++a is a=a+1; b=a;meaning.

    As for a++=a+a+1

    I guess I made a mistake.

    is a+=a+a+1

    Priority is equal to a=a+(a+a+1) a+=b is a simplification of a=a+b.

    It is not equal, it is a conditional operator, which is used to determine whether it is true or false.

    For example, 1! =2;The value of the expression is false, i.e. 0;

    Many formulas in the C language are simplified, which can save **, but it is more confusing.

  15. Anonymous users2024-01-24

    a++ is +1 after the operation, and when it is in the expression, it is still a, and ++a is to first a+1 and then substitute the expression for calculation.

    It is not equal to the meaning.

  16. Anonymous users2024-01-23

    a>b!=c means that a and b are compared first, and then the value of the expression a>b is not equal to the expression of c.

    Break back, and then get the result of the answer expression.

    For example: when a=2, b=1, c=1. The execution process of the statement is as follows:

    Execute a>b first, because a=2, b=1, so a>b is converted to 2>1, and the result of the execution is 1, because in c language non-0 is 1. Then judge 1! =1, because 1=1, the result of the expression is 0, which is the execution flow of the statement.

  17. Anonymous users2024-01-22

    a>b returns the logical bool value, compares the comparison result of a>b with the value of c, and returns the comparison result again.

    It seems that the two expressions you give are only ...... difference between Chinese parentheses and English parentheses

  18. Anonymous users2024-01-21

    Friend, > is a comparison operator,! = is a logical operator! Its priority is lower than that of the comparison operator, so first determine whether a>b are specialized.

    If it is true, then it is 1 if it is a>b whole, and 0 if it is not true, and then judge whether a>b is equal to c, and if it is not equal to a>b!The formula =c is 1 as a whole, and if it is equal to c, then a>b!=c

    This equation as a whole is 0It should be used to determine whether the value of c is 1 or 0.

  19. Anonymous users2024-01-20

    First determine whether a>b is true, if so, then a>b is 1 as a whole, and 0 if it is not true, and then judge whether a>b is equal to c, if not a>b!The formula =c is 1 as a whole, and if it is equal to c, then a>b!=c is 0

  20. Anonymous users2024-01-19

    Typical Chinese education... Who would write that in **?

  21. Anonymous users2024-01-18

    It should be used to determine whether the value of c is 1 or 0.

  22. Anonymous users2024-01-17

    C language (A>B)? a:b means the expression if the result of a>b is true.

    The result of the return will be A, and the result of the expression will be 0, then the result of the expression will be B. This is the only trinocular operator in the C language, and it simplifies many expressions. It is good for the writing of **.

    The evaluation rule is as follows: If the value of expression 1 is true, the value of expression 2 is used as the value of the conditional expression, otherwise the value of expression 2 is used as the value of the entire conditional expression. Conditional expressions are often used in assignment statements.

  23. Anonymous users2024-01-16

    Trinocular arithmetic The value of b is taken when a is greater than b, and the value of a is taken when a is less than b.

  24. Anonymous users2024-01-15

    (a>b)?a:b

    Indicates that if a>b is true, then the first value after the question mark is taken, here a

    If a>b is not true, then take the second value after the question mark, which is b

  25. Anonymous users2024-01-14

    means division, a and b are integers, so a b is calculated as an integer.

    C Language Operator:

    Logical non-operators.

    Bitwise inverts the caller operator.

    Autoincrement operator.

    Self-decrement operator.

    Negative operator.

    Type) type conversion operator.

    Pointer operator.

    Addresses and operators.

    sizeoflength operator.

    Expand the information of the Zen sideCharacteristics of the C language.

    1. In the standard C documentation, there is no very clear explanation of the binding nature of operators. A perfect score: it's the arbiter, deciding which one to execute first when several operators have the same priority.

    2. The C language also stipulates different combinations of 34 operators. Most operators combine in the direction of "left to right", i.e., left first and then right, also called "left binding", for example, a b+c, there are two operators in the expression, and the + operator has the same priority.

    3. There are three types of operators in the C language, which are from the right to the left of the sum faction, also known as the "right combination", namely: monocular operators, conditional operators, and assignment operators.

Related questions
16 answers2024-03-22

Beijing Municipality (Beijing).

Jing A, Jing C, Jing E, Jing F, Beijing City (urban area), Jing G Beijing (far suburbs), Jing B Taxi, Jing o Police. >>>More

16 answers2024-03-22

2b is a pen, which can also refer to Hongxing Erke, of course, it can also refer to the landlord.

3 answers2024-03-22

3c=three corridors.It is an RPG of War3 and is popular with the majority of War3 players. Especially the welcome of the students on the university campus. >>>More

7 answers2024-03-22

2c means:It is the meaning of business to customer, the pronunciation of 2 in English is the same as to, business-to-customer is the meaning of business to customer, abbreviated as b2c, and its Chinese abbreviation is "business to customer." >>>More

8 answers2024-03-22

B flat major has two flats, followed by two notes 7 (ti (mi). >>>More