C language puzzle solving, C language, puzzle

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

    I thought about it for a long time and didn't come up with it.

    There is a static variable m

  2. Anonymous users2024-02-06

    There's something wrong with the question you're asking.

    I don't think anyone can complete your program.

  3. Anonymous users2024-02-05

    1. Ba: denotes occimal, 9 illegal D: is the string 2, bc

    A byte occupies eight bits, so the int type mentioned in the question occupies 16 bits, because the highest bit is the sign bit, so the range is -2 15 to 2 15-1, which is the range of -32768 to 32767, so a is correct. b is incorrect.

    Look at option c, it starts with 0, which means that it is an octal number, and the octal number is represented by 0 7, and there will be no two numbers, 8 and 9, so c is also incorrect.

    Option d 0x starts with hexadecimal number, which can be represented by 0 9 and the letter a f, 0xfa it is 250 when converted to decimal

    3. A escape character starts with .

  4. Anonymous users2024-02-04

    1, d, because the characters are used' 'Whereas strings are used""

    2, b, think about 1 byte, all permutations and combinations of the number of 2 8 means that the range of values is [0,255], when it is a negative number [-128, 127], so when it is 2 bytes, the int type has a positive number and a negative number, take the value range [-32768, 32767], when it is signed, the maximum positive number is easy to understand, because the highest position in the computer is 0 means a positive number, so the maximum positive number is: 0111 1111 1111 1111 This is the maximum positive integer of 2 bytes.

    3. a, the escape character starts with . No, it's definitely not.

  5. Anonymous users2024-02-03

    The first question b and c, c represent the characters with an octal value of 034 on the ASCII table. There is no 9 in octal in a, and d at the end is an empty string in double quotes. Not characters. There are pictures to prove it.

    C is a little wrong in the way it is noted, and 0 is added before the octal system. But since the compiler defaults to the second question: the c option is recognized as octal, because the representation is octal.

    However, the maximum number of signatures that can be stored in 2 bytes of storage space is 32767, but there is no + sign in front of b to emphasize that it must be signed int. The unsigned number is expressed in the range of 0-65535

    Question 3, A, this one is very simple, option A does not have an escape character.

    I can legitimately and reasonably tell you that this kind of question is only available in China and Japan, in short, the interpretation of the final answer is in the hands of the questioner, if you are not an exam, this kind of question is really disgusting and useless.

  6. Anonymous users2024-02-02

    1.The answer is C, first of all, the character constant, it should be a single character, so D is excluded, because D is represented by double quotation marks as a string, and then look at A and B, since all ASCII codes can be represented by " " plus a number (usually an octal number). c defines some letters preceded by them"\"to represent common ASCII characters that cannot be displayed, such as 0, t, etc., are called escape characters.

    So A and B are wrong.

    2.Answer B, it has been said that int occupies two bytes, so the range that can represent the data should be -32768-32767.

    3.Answer A, Reason 1 has already said, the escape character must have a beginning with .

  7. Anonymous users2024-02-01

    If you choose to enter 5, then the result of if(a++>5) is false, because a++ is posterior+, it is to take the value of a first, and then the value of a +1, so if(a++>5) is actually if(5>5), which is false, and then a becomes a+1=6, execute the else statement, print the value of a--, because a-- is a postposition--, so first take the value of a, and then put the value of a-1, so the value of a-- is 6, and then the value of a becomes a-1=5

    Conclusion: The result of the program is output 6, if you add another statement after it: printf("%d",a);The output value is 5

  8. Anonymous users2024-01-31

    b。Clarify the difference between A++ and A, and you will know the answer.

Related questions
16 answers2024-04-07

Definition of a for loop.

for(the initial value of the variable; termination of operating conditions; The initial value of the first cycle i is 0, and it runs until i=3 stops i=2, and the condition is still satisfied, and the loop body is still executed, and the step size is 1+1 each time >>>More

10 answers2024-04-07

main() [main function main program].

int i,j,k;【Define integer data i,j,k】for(i=1; i<=6;i++) main loop, i from 1 to 6, increasing to 1] for(j=1; j<=20-2*i;j++) subcycle, j from 1 to 20-2*i >>>More

10 answers2024-04-07

General solution: A total of 789 numbers are needed to compile the pages of this book, and it is estimated that the total number of pages of the book should not exceed three digits. Since it is no more than three digits, it can be calculated by classification. >>>More

12 answers2024-04-07

This problem requires understanding that the system allocates memory to static variables when compiling, and the memory units occupied by them are not released after the function call ends, that is, the value of the variable is the value of the previous function call at the next function call. >>>More

9 answers2024-04-07

Hey! This is a very simple function to write, Your Excellency is estimated to have just learned data structures, now learn sorting, lookup, it's easy to give me a reward of two hundred points, I'll help you write it right away. >>>More