Ask the master to do a C language

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

    #include

    void main()

    int i;

    int j=17;sum of 2+3+5+7;

    for(i=2;i<=100;i++)

    if(i%2)

    if(i%3)

    if(i%5)

    if(i%7)

    printf("%d ",i);

    j+=i;Add up all the primes.

    printf("100 is the sum of prime numbers");

    printf("%d",j);The result is 1060 (depressed, which is also too poorly written).

    When I finished writing it myself, I felt like ...... rubbish

  2. Anonymous users2024-02-06

    # include

    # include

    void main ()

    int isprime(int);Function declarations.

    int m,sum;

    sum=0;

    for(m=2;m<=100;m++) 1 is not prime, so start the loop from 2.

    if(isprime(m)==1) *Directly call the function to determine whether m is prime, if so, execute sum=sum+m *

    sum=sum+m ;

    printf("%d",sum);

    int isprime(int n)

    int i;

    for(i=2;i<=(int)sqrt((double)n);i++)

    if(n%i==0)

    return 0;

    return 1;

  3. Anonymous users2024-02-05

    Choose b because the strlen function is a function to find the length of the string, and the problem needs to output the length of the string"ats"It's 3 characters"is 1 character (the backslash is an escape),"012"It's 3 characters, 1"It's 1 character (the backslash is an escape character), a total of 8 characters, so the answer is 8, choose B

  4. Anonymous users2024-02-04

    1 9 Take VC++ as an example, open the VC++ software, and click the "File" button in the upper left corner 2 9

    Click "New".

    Click on the "File" tab.

    Select the C++ Source File file and enter the file name 5 9

    Click "OK".

    Okay**, click the "compile" button to compile 7 9

    The prompt has no errors and warnings and generates a "obj" file 8 9

    Click the "build" button to debug, prompt that there are no errors and warnings, and generate a ".".exe' file.

    Click the "buildexecute" button to see the effect in action

  5. Anonymous users2024-02-03

    Your question is just too general. Because the specific requirements of your program are not written, no one else will be able to answer your questions. How to program in C?

    If the C source program is the simplest, it can be as simple as outputting only one of the most classic strings in many C textbooks:"hello, world !"If the C function is complex and very difficult to debug, the C source program can involve various operations on pointers and linked lists.

    Because the well-known C language is very powerful. Its performance lies in its powerful pointer function!! Namely:

    As long as you define a pointer variable correctly, and you are very comfortable and really able to grasp the use of various types of pointers, it is easy to have the pointer variable read (or write) to any storage area in the computer operating system.

  6. Anonymous users2024-02-02

    There are many students in college who are learning C language, C++ is a kind of C language, so how to write a simple program hello world in C language, let's show you below.

    Turn on step-by-step reading mode.

    Tools: Computer, C language software.

    How it works: 01 Double-click the C language software with the left mouse button, open it, open the interface as shown in the figure, click to close it02Click on the file in the upper left corner of the program window above, select New03 Select the file in the open window, the bottom is generally the fourth C++ source file, enter the file name (, be sure to use "..)c" is the suffix.

    04 Enter the page, the page source** can.

    #include

    void main()

    Then select Save, Print, Output Run.

    05 The effect of the output is like this, a simple C language program is written with special prompts.

    All inputs must be entered in English half-width, otherwise the program will not recognize and will report an error.

Related questions
7 answers2024-04-09

Note: This analysis is based on:

1,(from is a read-only property of public, sort has 17 overloaded methods, clone method inherits from object and is also defined in the array class, and copyto also has two overloads. So let's look at the length this way. >>>More

9 answers2024-04-09

However, it is clear that this is problematic because variable a is not assigned at all. >>>More

11 answers2024-04-09

I feel very simple...

#include >>>More

5 answers2024-04-09

Define an array of scores to record scores, record rankings and score bins. >>>More