What s wrong with my C program? What s wrong with this C program?

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

    Cite month[12][10]; Wrong. Without the element month[12][10], up to month[11][9], and the pointer p is useless. There's also the deletion of all your +10-level corresponding *.

    In a two-dimensional array, only the first subscript represents the address at the beginning of the row, and the address in scanf is not the variable name.

  2. Anonymous users2024-02-04

    Hello, you made a mistake at scanf.

    If I'm not mistaken, it should be scanf("%s", the first address of the string);

    Don't forget to end your typing with '0'.

  3. Anonymous users2024-02-03

    =0)!=0? printf("not"):(t=(a+b+c)%2);

    And. t==0? printf("yes"):printf("not");

    It's two "sequential" commands, so in some cases both statements are executed.

    Since the sum of two odd numbers and an even number must be even, you can first determine whether the sum of the three numbers is even; And since there are only two cases when the sum of three numbers is even: 1, two odd numbers and an even number, 2, and three are even numbers, so as long as one of the three numbers is judged to be an odd number, it can be proved to be the first case, that is, what the question asks:

    #include

    void main()

    int a,b,c;

    scanf("%d,%d,%d",&a,&b,&c);

    a+b+c)%2==0?(a%2!=0||b%2!=0||c%2!=0?printf("yes"):printf("not")):printf("not");

  4. Anonymous users2024-02-02

    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;

Related questions
4 answers2024-02-09

1. Flashing and rooting are the underlying operations of the operating system of the mobile phone, and it is not recommended for non-professionals to flash and root. >>>More

7 answers2024-02-09

C language does not round, if you want to round it, such as a to keep two decimal places: >>>More

14 answers2024-02-09

First question: What does exit failure mean? Why do you need this thing in this program? >>>More

16 answers2024-02-09

int main()

int i,j,a[100]; >>>More