Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Other Programming (https://www.askmehelpdesk.com/forumdisplay.php?f=437)
-   -   Please find the error of this source code for me. (https://www.askmehelpdesk.com/showthread.php?t=636174)

  • Feb 15, 2012, 08:10 AM
    lianardo
    Please find the error of this source code for me.
    #include<stdio.h>

    Int I,j;
    Void calculate(const int b[i][j]);
    Int main()
    {
    int a[i][j];

    cal(a);
    printf("the average is %d",calculate);
    }

    Void calculate(const int b[i][j])

    {

    int counterA=0, counterB=0, counterC=0, counterD=0, counterF=0;
    int sum=0,avg,grade;

    for(I=0; I<4; I )
    for(j=0; j<2; j )

    {

    printf("Enter student grade >> ");
    scanf("%lf", &grade);
    sum =grade;
    avg=sum/8;

    if(grade>=80)
    {
    counterA ;
    }

    else
    if(grade>=70 && grade<80)
    {
    counterB ;
    }

    else
    if(grade>=60 && grade<70)
    {
    counterC ;
    }

    else
    if(grade>=50 && grade<60)
    {
    counterD ;
    }

    else
    {
    counterF ;
    }

    }

    printf("\nThe number of student that get A are >> %d", counterA);
    printf("\nThe number of student that get B are >> %d", counterB);
    printf("\nThe number of student that get C are >> %d", counterC);
    printf("\nThe number of student that get D are >> %d", counterD);
    printf("\nThe number of student that get F are >> %d", counterF);
    }
  • Feb 15, 2012, 09:31 AM
    Curlyben
    What EXACTLY is the error message you are getting.
    Debugging someone's else's code is a PITA without error messages to work on..

  • All times are GMT -7. The time now is 04:31 AM.