A small calculation problem in C, a small calculation problem in C, a calculation problem in C?

Updated on educate 2024-08-08
8 answers
  1. Anonymous users2024-02-15

    Oh, it's actually very simple, you first have to know their priority, this equation, you must have 1: first calculate the following a*a, you should know this, this does not count out is 144

    Next 2: Execute a-=144; This step is equivalent to a=a-144; The result is a=-132;

    3: From the above result, it has been calculated that a=-132;This is the key, and the last one is a+=-132; The result is equivalent to a=a+=-132; "Here a=-132 ha" The result is naturally -264.

    I don't know if I'm talking too long-winded ......Hee-hee......I hope you understand, if you still don't know why you need to calculate that step first, it's best to look at the priority mentioned in the book.

  2. Anonymous users2024-02-14

    Because a+=a-=a*a, it is calculated from right to left.

    That is, a*a is calculated first, so the result is 144, because the value of a is still 12.

    Secondly, it is calculated that a-=144

    Because the value of a at this time has not changed, that is, a=a-144, therefore, the value of a is -132 Finally, a+=-132 is calculated, that is, a=a+132, so a=-264

    Do you understand? If you don't understand, you can come to me directly :)

  3. Anonymous users2024-02-13

    abs() is a function that Li Yu uses to calculate the absolute value of a floating-point number. The meaning of this loop statement is that when the absolute value of t is greater than or equal to 2e-6, ** in the loop body is executed. The specific explanation is as follows:

    fabs() is a function that buries the absolute value of floating-point numbers, because there is no built-in absolute value function in C. The fabs() function is declared in the library and needs to be included before it can be used.

    While is a loop statement in the C language, followed by an expression in parentheses to indicate a loop condition. Only if the expression in parentheses is true, the statement in the loop body will be executed. If the expression is false at the beginning, the statement inside the loop will not be executed.

    In this loop, fabs(t) >2e-6 indicates that the statement in the loop will be executed when the absolute value of t is greater than or equal to 2e-6. If the absolute value of t is less than 2e-6, the statement in the loop body will not be executed, and the loop will end.

    By changing the expression in the while statement, Nexian Rock can achieve different cycle conditions and operations in the loop body. In this example, when the absolute value of t is greater than or equal to 2e-6, the operation in the circulation body is repeated until the absolute value of t is less than 2e-6.

  4. Anonymous users2024-02-12

    The printf() function is calculated from back to front.

    Calculate -i --. first-8 is obtained, at which point i has become 7, and the same can be done.

  5. Anonymous users2024-02-11

    The printf statement starts with the following arguments and then calculates the preceding arguments. That is, first -i--, then -i++, and note that i++ is to take i first, then ++, and i is first ++ and then i. As a result, it was.

  6. Anonymous users2024-02-10

    The first thing to do is to convert 10 to binary.

    The value is 1010

    Then it's the inverse, then it's 0101

    Converting it to decimal again is 5

  7. Anonymous users2024-02-09

    a=10

    AA's anti. Complement representation. Subtract one to negate.

    Decimal - 11

    Output-11

  8. Anonymous users2024-02-08

    +i, which means that 1 is added first;

    i++, which means i, and then self-adding;

    i, i--the same way;

    The first ++i adds 1 first, so the output is 9 (at this time i is already equal to 9);

    the second --i, which subtracts 1 first, so the output is 8 (i=8 at this time);

    The third i++, complete the operation first, and then add 1, so the output is 8 (at this time, i=9);

    Four or five, since the priority of -(negative) [not subtraction operation] is higher than ++, and then refer to the above, think about it yourself, the answer is, -9 (i=10); -10(i=9)

Related questions
4 answers2024-08-08

It's not very hard that the tail node next points to null. >>>More

14 answers2024-08-08

The general process for mainland customers to purchase insurance in Hong Kong is as follows:1You can first communicate with the company's financial advisor, and note that it is a real financial advisor registered with the Hong Kong Insurance Regulatory Commission. >>>More

12 answers2024-08-08

The conditions for this problem are insufficient, and the conditions are insufficient to solve it! >>>More

23 answers2024-08-08

3co2...This conservation of atoms can be seen by looking at it. >>>More

14 answers2024-08-08

Go to the bookstore and buy a copy of the second year of junior high school physics exercises and detailed explanations.