Calculate the factorial sum from 1 to 20 and write it into a program

Updated on technology 2024-05-29
9 answers
  1. Anonymous users2024-02-11

    # include

    int main()

    double a,i=1,b=1,sum=0;

    for(a=1;a<=3;a++)

    This curly brace is not necessary.

    for(i=1;i<=a;i++)

    b=b*i;Write programs with indentation (formatting).

    That's not necessary.

    sum=sum+b;

    Here you need to add:

    b=1;printf("sum=%e",sum);

    return 0;

  2. Anonymous users2024-02-10

    For assembly language, the results are sufficiently expressed in two words.

    option arithmetic decimal_highlet fact=1

    let sum=0

    for i=1 to 20

    let fact=fact*i

    let sum=sum+fact

    print i,fact,sum

    next iend

  3. Anonymous users2024-02-09

    It's good to be together? There is no point in the house. You want me to go to ** to have fun, you want me to go ** to have fun. You want.

  4. Anonymous users2024-02-08

    Personal testing is available. long jiecheng(int x)long int i,k=1;

    for(i=1;i<=x;i++)

    k=k*i;

    return k;

    int main()

    long int j,k=0;

    int i;

    for(i=1;i<=20;i++)

    j=jiecheng(i);

    k+=j;printf("%ld",k);

    The result of the output is 2561327494111820313<>

  5. Anonymous users2024-02-07

    Classic examples of the C language are 1+2!+3!+.20!of and.

  6. Anonymous users2024-02-06

    1. Program analysis: This program just turns accumulation into accumulation.

    2. Program source**.

    main()

    float n,s=0,t=1;

    for(n=1;n<=20;n++)

    t*=n;s+=t;

    printf("1+2!+3!..20!=%e",s);

    3. Introduction to C language:

    1) C language is a general-purpose computer programming language with a wide range of applications. C is designed to provide a programming language that can compile in a simple way, handle low-level memory, generate a small amount of machine code, and run without any runtime support.

    2) Although C provides many low-level processing functions, it still maintains good cross-platform characteristics, and C language programs written in a standard specification can be compiled on many computer platforms, including some embedded processors (microcontrollers or MCUs) and supercomputers and other operating platforms.

    3) In the eighties of the twentieth century, in order to avoid the differences in the C language grammar used by various developers, the National Bureau of Standards of the United States formulated a complete set of international standard grammar for the C language, called ANSI C, as the initial standard for the C language.

  7. Anonymous users2024-02-05

    It's just a slight change to the above brother.

    #include

    void main()

    printf("%d", s);

  8. Anonymous users2024-02-04

    Kun、It means that the second one is better.。。。 Tan Haoqiang killed people and didn't pay for his life...

  9. Anonymous users2024-02-03

    <>2. Set a temporary variable in the program and the sum variable that accepts the sum of the factorials, first iterate the numbers within 20 in the loop, and then calculate the factorial of each number, and add them up, because it is a very large number of quiet files, so the sum here is of the double type, and finally the result can be output:

    3. Finally, debug the compiler, and you will see the sum of the output within the 20th factor, which is a very large number. The above is how to find the factorial sum within 20 in C

Related questions
11 answers2024-05-29

You can enter 1 in cell A1

Enter 2 in cell A2, then select these two cells, click and hold a small black dot in the lower right corner of the selected area, drag down to a single cell 1 and enter a formula: =A1*A1, and press Enter. >>>More

7 answers2024-05-29

First, open the black diamond in the fashion of buying (experience bonus gives 32 more PL), and second, find a long-term ** master, preferably the kind of businessman (it doesn't matter if you bring it, as long as ** has an experience bonus). >>>More

18 answers2024-05-29

3:20 a.m. isUgly timeThe time period is from 1 a.m. to 3 a.m. >>>More

6 answers2024-05-29

There is no limit to the subject matter, there is no limit to the rhyme, there is no limit to the number of words, as long as it is original and it is a poem that expresses love, such as sunset. Come on, Global Chinese Online Home, February 14, 2008. Malaysians may refer to Mandarin, Cantonese, and Hakka as Mandarin; Foreigners also think that they are speaking Mandarin when they listen to what Hong Kong people say. >>>More

13 answers2024-05-29

The cost of production of the ironmaking process.

The composition is mainly raw materials (pellets, iron ore. >>>More