c Where is the error 20

Updated on technology 2024-02-09
5 answers
  1. Anonymous users2024-02-05

    Note that this is C, not C++

    scanf("%d",&a[i]);i is not initialized. The default value is 0??It's been a long time since I've done C.

    for(i=0;i<6;i++)

    for(i=6;i>0;i--) I use i for both layers of cycles, and I don't know what I want to do.

  2. Anonymous users2024-02-04

    #include""

    void main()

    int a[6]=;

    int i,temp;

    printf("Original array:");

    printf("Insertion and arrangement of data");

    printf("Enter an integer:");

    scanf("%d",&a[6-1]);

    for(i=0;i<5;i++)

    for(int j=0;j<5-i;j++)if(a[j]>a[j+1])

    temp=a[j];

    a[j]=a[j+1];

    a[j+1]=temp;

    printf("The array elements are arranged as:");

    for(i=0;i<6;i++)

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

    printf("");

  3. Anonymous users2024-02-03

    This program will report an error because it is not allowed to define a variable with the same name as an externally defined constant in the main function. You can change the variable name inside main to something else, or delete it.

    Yes, inside main there is a new pi variable that has the same name as the global constant pi, but it is not a constant, and it can be modified, which will cause the program to be incorrect.

    The solution is to use a different name for the pi variable in main to avoid name conflicts, e.g

    #include

    const double global_pi=;

    int main(){

    double local_pi=;

    double area;

    double r=;

    area=local_pi*r*r;

    printf("The area is: %2f",area);

    return 0;

  4. Anonymous users2024-02-02

    The C++ procedure for the corrected high-precision division is as follows (see figure, see note for changes) <>

  5. Anonymous users2024-02-01

    Do you understand the logic of division? Don't rush to write**, use pen and paper to think clearly about the logic first.

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

    a=a*10;Take this sentence as an example, a=a*10, you didn't remove the integer part of a b, right? So the result must have been wrong.

    s+=char(a/b+'0');

    a=a%b;

Related questions
7 answers2024-02-09

Agar, scientific name agar, English name (agar), also known as foreign cabbage (agar-agar), frozen powder, swallow vegetable essence, foreign powder, cold weather. Agar has a unique property that is extremely useful in applications in the food industry. >>>More

9 answers2024-02-09

Investors search for investment companies or projects through the Internet, pay funds or become shareholders of the company directly or indirectly, and the investors are often accompanied by clear financial return requirements. The crowdfunding platform mainly plays the role of online display of projects and offline matchmaking. The transactions are also completed, mainly with the participation of professional investors, sometimes one or two people invest, sometimes three or four people invest. In essence, the link of finding projects at the front end of VC investment has been moved online, but the advantage is that this model solves the problem of information asymmetry between projects and funders, and also eliminates geographical restrictions, so that more entrepreneurs have the opportunity to find venture capital and raise funds. To be precise, angel crowdfunding should be a typical representative of the equity crowdfunding model, which is basically no different from angel investment and VC in real life, except that the fundraising link is completed through the Internet. >>>More

5 answers2024-02-09

Welcome to the Wine Festival, a great festival dedicated to celebrating the great invention of alcoholic beverages! Winemakers from all over Azeroth come together on this special day to exchange secrets about winemaking. During the festival, there are also a variety of banquets and games for guests to participate in, so get ready to have a drink! >>>More

4 answers2024-02-09

Extraction code: hc59 "Batman: The Dark Knight Ries" (The Dark Knight Ries) is adapted from DC Comics' classic super hero comic "Batman", directed by Christopher Nolan, starring Christian Bale, Anne Hathaway, etc., is the final chapter of Nolan's Batman series trilogy. >>>More

11 answers2024-02-09

The earliest human direct evidence to study the origins of humans comes from fossils. Anthropologists use the method of comparative anatomy to study various fossils of ancient apes and humans, determine their relative and absolute ages, so as to determine the age of human fossils, and roughly divide the evolutionary history of humans into several stages. Geneticists use biochemical and molecular biology methods to study the size and rate of mutation of proteins and deoxyribonucleic acid (DNA) between modern humans, various apes and other higher primates to calculate their respective origins and differentiation ages. >>>More