What is the result of this C language question, ask for an explanation

Updated on educate 2024-04-09
14 answers
  1. Anonymous users2024-02-07

    The program is wrong, and the result after running is 5, 5, 5, 5 .........Infinite 5) The following places are wrong:

    # include

    # define n 8

    void fun(int * x,int i)* x=*(x+i);}

    main()

    int a[n]=,i;

    fun(a,2);

    for(i=0;i=n/2;i++) shilling i=0, the second one should be a bool expression, you wrote an assignment expression, and there is an error here.

    printf("%d",a[i]);

    printf("");

  2. Anonymous users2024-02-06

    fun(a,2) is to pass in the address of a[0], and the function does a[0]=a[2].

    Then output half of the array, 3,2,3,4

  3. Anonymous users2024-02-05

    # include

    # define n 8

    void fun(int * x,int i)* x=*(x+i);}

    main()

    int a[n]=,i;

    fun(a,2);After running: the result of a is: a[0--7]= that is, a[2]--a[0].

    for(i=0;i=n/2;i++) It's an endless loop here. Is it to iprintf("%d",a[i]);

    printf("");

  4. Anonymous users2024-02-04

    The results are all 5

    There's a problem!

  5. Anonymous users2024-02-03

    Here's ** to write it more clearly:

    if(a>b)

    c=a;a=b;

    b=c;If only one sentence is included in the compound statement: c=a; The judgment of A>B is obviously not valid, and this sentence will not be enforced.

    After that, the remaining two sentences are executed sequentially:

    a=b;A is 10

    b=c;b is 16

    So the end result:

    a = 10, b = 16, c = 16 if changed to:

    if(a>b)

    Here is that the if compound statement contains 3 sentences, the 3 sentences are not executed if the conditions are not established, and the final result of the 3 variables is unchanged.

  6. Anonymous users2024-02-02

    Because a b is false, c=a is not executed

    So execute a=b, so a=10

    Then b=c, so b=16

    So in the end it's 10, 16, 16

  7. Anonymous users2024-02-01

    There are no special curly braces, so only the last two sentences are executed.

    i.e. a=b; b=c;

    Note that it's an assignment, not an equal.

    Then the final answer is d

  8. Anonymous users2024-01-31

    If the statement does not have a curly brace enclosed number, only the first " is executed;

    If a>b, c=a; And a just executes a=b; b=c;

    a=10;b=16;

    c=16

  9. Anonymous users2024-01-30

    Here the if statement does not add curly braces, so the conditional judgment of the if statement only corresponds to c=a; This sentence.

    Because a only executes a=b; b=c;

    So the answer is d

  10. Anonymous users2024-01-29

    If not true, the first step is not involved, operation 2 3 steps are enough, 2: a=b a=10 b=103: b=c b=16 c=16 finally a=10 b=16 c=16

  11. Anonymous users2024-01-28

    If the poster is sure that the program is okay, the answer is: d

  12. Anonymous users2024-01-27

    Calculate and output numbers between 100 and 150 that are divisible by 3, in a row of 10.

  13. Anonymous users2024-01-26

    This is the relationship between the structure and the common body, basically this structure is that each byte has its own internal error space, and the common body is all the functions, a piece of no space, you now assign a value of 1234, that is, the common body is 1234, because the whole common body is in the memory applied for by word, that is, 4 bytes, the first two bytes of the four bytes are occupied by the structure, that is to say, low and high each occupy one, and the printing result is: word= 1234, high=03, low=04, the last one is 12ff Hope it helps.

  14. Anonymous users2024-01-25

    S is reassigned and accumulated each time in the loop body, so only the last round of loops is calculated.

    k=5,s=1+5=6

    Select Answer B

Related questions
8 answers2024-04-09

This is very easy to understand, let me give you a number, take n=5, although the compiler has an execution order, but theoretically it can be considered that s1 and s2 are executed at the same time, and look at it in comparison. >>>More

27 answers2024-04-09

Look at the process of this bet, if you want to make this bet, the premise is that you have a bet, what is your capital, how sure are you that you can win, and the bet with happiness will end up being a lifetime of happiness or losing a lifetime of happiness.

9 answers2024-04-09

Normal There are antibodies Very good High transaminase does not mean that there must be hepatitis, some colds can cause it to be high But people with hepatitis transanase must be high Transanase is a catalyst for the conversion of amino acids secreted by liver cells For example, if you eat animal protein to become your own, you have to rely on the catalysis of transaminases But some inflammation may cause the cell membrane of hepatocytes to become larger and release excessive transaminases But it is not necessarily hepatitis A cold or something may affect Ha

7 answers2024-04-09

The worst outcome is suicide.

4 answers2024-04-09

I'm sorry, I'm an obstetrician and gynecologist, and I don't know much about ophthalmology.