C language writing question 09, C language question for explanation

Updated on technology 2024-05-25
4 answers
  1. Anonymous users2024-02-11

    2. The identifier must start with the letter a z, a z or an underscore, select b

    3. Assign C correctly to A and B, and require A=C and B=C to be true at the same time, choose C

    Question 6, the characters between %d in double quotation marks in the scanf statement should be entered as is, select b

    7 questions, t is double type, t = 1, t = t + 5, automatically convert t from integer to double type, select b

    8 questions, convert letters to ascii** when calculating, it is 65 + (102-97 + 1) = 71, corresponding to the character g, choose a

    9 questions, in C language, true is 1, non-true is 0, 3 plus 5 is 8, not equal to 9, the judgment value is true, choose D

    10 questions, scanf("%3d%3c", &x, &y), assign the first three digits of the input characters to x, and the next three digits to y, but if they do not meet the format requirements, it will be automatically judged as the end of the input, and b is selected

  2. Anonymous users2024-02-10

    When i=10, the i<10 condition is not valid, and the cycle ends.

    So in the end i=10

  3. Anonymous users2024-02-09

    is equal to 5234, because s2 is not empty from 0 to i=2, so s2[i]=s1[i]; They will all be executed consecutively because of i++.

    Therefore, the value of s1 will be added by 1 bit to cover s2, that is, 5 will not change, and the loop will be successfully executed four times, so the value of 234 will replace 6, 7, 0 in turn, and then the fifth time will not be executed, so the output is 5234The corresponding numerical changes are given below.

    i=0 > s2[0]=5!='\0'Cycle > i++ i=1 > s2[1]=s1[1] s2[10]="527", s1[10] unchanged.

    i=1 > s2[1]=2!='\0'Cycle > i++ i=2 > s2[2]=s1[2] s2[10]="523", s1[10] unchanged.

    i=2 > s2[2]=3!='\0'Loop" i++ i=3 > Note that at this time, s2 takes the value of the fourth digit, that is, the value obtained is null, so it is s2[3]='\0'Then reassign s2[3]=s1[3]=4 s2[10]="5234"

    At this point, it should be noted that the current s2 is fully in line with the judgment conditions, so a loop must be executed.

    i=3 > s2[3]=4!='\0'What happens to the loop > i++ i=4 at this point, which is s2[4]='\0'

    s1[4]='\0'So after normal execution of s2[i]=s1[i], it will be like s2[10]="5234"I won't give you the six zeros in the back. Circular judgment is then performed.

    i=4 > s2[4]='\0'Interrupt the loop to execute the next **.

    puts(s2);

    Result: 5234 If you don't understand and ask again, you will reply when you see it.

  4. Anonymous users2024-02-08

    #include

    include program error, missing header file void main() program error, missing definition of type main The output is 5234567

Related questions
3 answers2024-05-25

Heada and headb are both singly linked lists with leading nodes. In this algorithm, we delete the common elements from the ith element in the heada linked list, and then insert the single-linked list heada before the jth element of the headb. >>>More

11 answers2024-05-25

Your logic is not wrong.

There's a slight mistake with your format: scanf("%d,%d,%d", y, m, d) should be replaced by : >>>More

9 answers2024-05-25

Scope. You static char *chh;

static char *ch1;Although the address pointed to by the two pointers does not change, have you ever wondered whether the memory address they point to has been released, char chc[10]; It's local, the function is out, the lifecycle is over, and you're trying to access it with a pointer in void times(). >>>More

14 answers2024-05-25

The program calculates the angle between the two needles at any time between 0:00 and 23:59. >>>More

7 answers2024-05-25

In the whole main function, only this one variable, whether it is the first for or the second for, is the same i, the second for will have i=-1, in the case of i= -1, and printf("%d ",a[i]);Statement. So fear not! When there is no second for the case: >>>More