One C level 2 question and two C multiple choice questions

Updated on educate 2024-05-17
12 answers
  1. Anonymous users2024-02-10

    For the operators of this problem, the order of priority is: parentheses () >'*'>'-'>'&&'

    So let's do (float) a= first

    Then calculate a*c='s'ASCII value.

    If you calculate again, the -b value is definitely not equal to 0, that is, it is true!

    Finally, the logic and operation with k are carried out, and the result is true, that is, 1, and the value is assigned to a, so a=1;

  2. Anonymous users2024-02-09

    C should be an ASCII code in the multiplication operation, C++ has a formula for priority to remove the highest parentheses, remove the lowest comma, and the rest is the one, two, and three-eye operators, so this question wants to be said by the previous brother, && left and right are true values, that is, 1, so the whole is 1

  3. Anonymous users2024-02-08

    Because logical operations have a lower priority than arithmetic operations, do (float) a*c-b first, and then do &&&k

    True and true are also true, so a=1

  4. Anonymous users2024-02-07

    This is a float a*c-b

    The calculated value is then &&&k

    So it is equal to 1

  5. Anonymous users2024-02-06

    & is a logical operation where both sides are not 0 at the same time, so the result is 1

  6. Anonymous users2024-02-05

    Trouble the dude upstairs to what's that:

    There is a mantra called to remove the highest parentheses, remove the lowest comma, and the rest is the one-two-three-eye operator".

    The little brother will be very grateful!!

  7. Anonymous users2024-02-04

    Hehe, the upstairs are all good...

  8. Anonymous users2024-02-03

    The assignment operator is operated from right to left, so a is wrong in assigning a value to the constant 1, which is 1=......The assignment operation in this step is incorrect. There are two operators in c parentheses, the double equals sign == is a logical operator, a decision operation, and then an assignment operation, no problem. In a, b=1 is changed to b==1 and it is still wrong, because there is an assignment operation to the right of the parentheses, (b==1)=1, then the assignment operation on the right has also become an assignment to a constant, which is another error.

    There is a static keyword before the definition of s, which indicates that it is a static variable, and the static variable will open up a separate address in memory, and will not be released after the function is executed, so the result can be accumulated.

  9. Anonymous users2024-02-02

    Option A is wrong not in the parentheses, but in the 1=, = outside the parentheses, which is to assign a value to the variable, == is to compare whether it is equal, and to assign a value to the number, it must be wrong.

    static is a static variable that can be used as a global variable with a fixed scope.

  10. Anonymous users2024-02-01

    1. One equal sign is assigned, and two equal signs are equal!

    The third option, b=c==9, is now assigned as c==9 and c==9 is of the bool type, so option c is wrong.

    2. The static variables defined in the method body are initialized, and the initialization operation will not be performed again (only executed on the first call).

  11. Anonymous users2024-01-31

    aJudge lowercase letters.

    c >=a’ &c <=z’

    Turn the jujube into a capital letter.

    c +=a’ -a’;Equivalent to c=c+('a'-'a');

    It's really nothing, you just have to take the ASCII table and you can see it at a glance.

    Careless, -

    The encoding of lowercase letters is after the uppercase letters, and the encoded value is greater than the uppercase letters, the lowercase becomes uppercase, and the numeric value becomes smaller.

    Well, choose c, if (c >=a'&&c <=z') c -=a' -a';That's okay too.

    Actually, we don't know which uppercase and lowercase letters are in front of and after, but we can also write the correct formula.

    Let's assume that the uppercase letter follows the lowercase letter.

    Then the distance between the uppercase and lowercase letters is'a'-'a'slow demolition;

    c=c+'a'-'a';c is sold in capital letters; (Lowercase letters plus distance are uppercase letters).

    if (c >=a'&&c <=z') c +=a' -a';That's fine

    badd(, produces ambiguity.

    For the compiler.

    2) double add(double a, double b)

    3) int add(double a, double b, double c = 0)

    Both of these functions can be represented as add(double, double);

    When you compile to this statement, the compilation will not know which function to call.

  12. Anonymous users2024-01-30

    Question 1c Question mark expression.

    Question mark expressions take precedence over assignment expressions.

    So execute the greeting expression first, and when the question mark is preceded by hail, take the expression before the colon call back and pay the value to c

    If false, the expression after the colon is given a value to c

    The ascii of lowercase and cavity is 32 larger than that of uppercase letters, i.e. a' -a'

    Needless to say, the second question is upstairs.

Related questions
7 answers2024-05-17

private sub command1_click()(100, -100)-(100, 100)dim x%, y% >>>More

4 answers2024-05-17

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

11 answers2024-05-17

1. If the point A(1+M,2M-1) is on the X-axis, then 2M-1=0, M=1 2, the point A is (3 2,0), the point P(3M+3,4M) is brought into M to get P(9 2,2), and the symmetry point about Y is (-9 2,2). >>>More

27 answers2024-05-17

1.If you want to be as high as possible, let the length of the rectangle be the height of the cylinder, and the width is the circumference of the bottom surface, and the radius of the bottom surface can be found according to the perimeter, and of course, the bottom area can also be found. >>>More

3 answers2024-05-17

This is the drawer principle.

There are a total of five possibilities for scoring after these two questions: 1Both questions are correct: 4 points. >>>More