C language, help me see how to do these two questions

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

    n!is the factorial of n, and its mathematical meaning is n!=1*2*3*4*..The NC language implementation is as follows: (the program is debugged in the Turboc environment) int factorial(int n).

    if(n == 1)

    return 1;

    elsereturn n * factorial(n - 1);

    main()

    int n,f;

    scanf("%d",&n);

    f=factorial(n);

    printf("%d",f);

  2. Anonymous users2024-02-06

    int jiecheng(int num).

    if(num==1) return 1;When num is 1, 1 is returned, which is the recursive pushout condition, which is num 1.

    return num*jiechent(num-1);This function is used again! That's recursion.

  3. Anonymous users2024-02-05

    Does this involve recursion? I didn't see it.

  4. Anonymous users2024-02-04

    If the condition in the if statement is to use an equal sign, it is an assignment statement, so if the assignment is greater than 0, the condition is true, that is, the first if is true, and the output is 5When the second condition is reached, since the assignment statement is equal to 0Therefore, if is false, execute the statement after else, i.e. the output is 4

  5. Anonymous users2024-02-03

    How do you come up with the question, I do it.

  6. Anonymous users2024-02-02

    a+=a-=a*=a

    Known a=6.

    1. Deformation: a+=a-=a*=6. Calculate a*=6, which is a=a*6, and the result is a value of 36 and return 36.

    2. So it becomes a+=a-=36. Calculate a-=36, i.e. a=a-36, and the result is a value of 0 and return 0.

    3. So it becomes a+=0, that is, a=a+0, and the result is a value of 0 and returns 0.

  7. Anonymous users2024-02-01

    The final answer is 0

    Because there is a-=a in it

  8. Anonymous users2024-01-31

    a = 6

    Execute a * = a, which is equivalent to a = a * a, get a = 36, then execute a -= a, which is equivalent to a = a - a, get a = 0, and finally execute a += a, which is equivalent to a = a + a, and get a = 0

Related questions
17 answers2024-04-06

Now it is not recommended to use 5000+ this CPU **Although it is very low. But personally, I think it's too outdated. >>>More

8 answers2024-04-06

Based on the information you provided, the analysis of this Bazi is as follows: >>>More

10 answers2024-04-06

It's been popular lately.

Open your task manager, if there is one or more running in the process, congratulations, it's stylishly poisoned! >>>More

8 answers2024-04-06

int a,b,c;

scanf("%d%d",&a,&b);Enter a, bc=a+b; Add the two numbers to c >>>More

9 answers2024-04-06

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