Ask two questions about the C language... Ask the experts to help analyze the next two programs

Updated on technology 2024-04-06
7 answers
  1. Anonymous users2024-02-07

    if(!a) x--;Meaning: if (!.)a) If true, execute x--。 Now 0 like a and 0 in c is false. So (!.)a)=true。So execute x--;

    while(m!=n) Translated into Chinese: When m!=n, the loop is executed. If m==n, the loop is out.

    ok?I hope you understand and you can analyze it step by step.

  2. Anonymous users2024-02-06

    if(!a) x--;

    If a is 0, if the judgment condition is true, x-- operation is performed, otherwise else processing is performed.

    There are two cases:

    A 0:0 is also a false flag, !A is true, then if the limb is valid.

    Not 0:!A is 0, which is also a false flag, and is handled by else.

    while(m!=n)

    When the values of m and n are not equal, the while loop continues (the statement in the loop body is executed) until the values of m and n are equal, the loop is jumped out and subsequent processing is performed.

  3. Anonymous users2024-02-05

    if(!a) x--;

    If! A is true ((!.)a)!=0) x--

    while(m!=n) Cycle when m is not equal to n.

  4. Anonymous users2024-02-04

    if(!a) x--;

    Here! It means "no". In other words! If the latter formula is true, "!".expression" will become untenableIf the latter formula is not valid, "!".expression" will become true.

    A is a number, if it is 0, it is not true, and other values are true. So (!.)A means to determine whether a is a non-0 number.

    For example: a=0, then if(!a) Establishment. a=1, then if(!a) Not established.

    while(m!=n)

    Here is to determine whether m is equal to n. Equivalent! ==。It's just written! = That's it.

    If m is not equal to n, then while(m!=n) established. If m is equal to n, then while(m!=n) is not established.

  5. Anonymous users2024-02-03

    if(!a) x--;When a=0, if the judgment condition is true, x-- operation is performed, otherwise else processing is performed

    while(m!=n) When m is not equal to n, the loop continues (continues to execute the statement in the loop body) until m and n values are equal, and then the loop is jumped out and subsequent processing is performed.

  6. Anonymous users2024-02-02

    a is when a is not equal to 0.

    m!=n is m not equal to n

  7. Anonymous users2024-02-01

    1、int

    x=2,y=2,a;

    a=(x=x+1)丨丨(y=y+1), the parentheses have the highest priority, and the x=x+1,x in the first parenthesis is calculated first

    3, 3 is not 0, is logically true.

    Logic or operator, if one side is true, then the result must be true, so ||The right side is not calculated, and the whole result is a logical true value assigned to a

    In the end, it is a=1, x=3, y=2 (y=y+1 is optimized and not calculated) 2, int

    x=2,y;

    x=(y=3,2+y,2*y)

    Inside the parentheses is the comma expression, and the result of the comma expression is the value of the rightmost expression, that is, the value of 2*y is the value of the expression (y=3,2+y,2*y), and then the value is assigned to x

    The comma expression is calculated from left to right, first y=3, then 2+y, and finally 2*y, that is, 2*3=6 is assigned to x

    In the end, it's x=6

Related questions
6 answers2024-04-06

Let me ask you your questions.

First of all, you are talking about whether the **game will damage the computer,It's inevitable,But you don't have to worry,Because usually**the damage to the hard disk is negligible,As long as it's not a frequent bt**,don't worry too much.。 >>>More

13 answers2024-04-06

Grounding Point: v2-= 0

then v2+ = bat2 >>>More

4 answers2024-04-06

FIBA is a 40-minute match, divided into two halves, 20 minutes each. >>>More

4 answers2024-04-06

You don't know anything about lawyers?! Want to be a lawyer? >>>More

9 answers2024-04-06

The original meaning of the question is to implement the function of one queue with two stacks. >>>More