Problem 17: GPA

Take a value from user and assume that- it is the number of his math exam.
Now you have to write a program which shows the grade depending on the given scale.
(A+: 80-100, A: 70-79, A-: 60-69, B: 50-59, C: 40-49, D :33-39 ,F :0-32)

2,603 total views, 4 views today

Comments

comments

6 thoughts on “Problem 17: GPA”

  1. #include
    int main()
    {
    int n;
    printf(“Enter your marks of math exam\n”);
    scanf(“%d”,&n);
    if(n>=80){
    printf(“You got A+\n”);
    }
    else if(n>=70){
    printf(“You got A\n”);
    }
    else if(n>=60){
    printf(“You got A-\n”);

    }
    else if(n>=50){
    printf(“You got B\n”);
    }
    else if(n>=40){
    printf(“You got C\n”);
    }
    else if(n>=33){
    printf(“you got D\n”);
    }
    else{
    printf(“You fail\n”);
    }
    }

  2. #include
    int main()
    {
    int M;
    scanf(“%d”,&M);
    if(M>=0 && M=33 && M=40 && M=50 && M=60 && M=70 && M=80 && M<=100){
    printf("A+");
    }
    return 0;

  3. int M;
    scanf(“%d”,&M);
    if(M>=0 && M=33 && M=40 && M=50 && M=60 && M=70 && M=80 && M<=100){
    printf("A+");
    }

  4. #include
    int main()
    {
    int M;
    scanf(“%d”,&M);
    if(M>=0 && M=33 && M=40 && M=50 && M=60 && M=70 && M=80 && M<=100){
    printf("A+");}
    return 0;
    }

  5. #include
    #include

    int main()
    {
    int marks;
    scanf(“%d”,&marks);

    if (marks=0){
    printf(“Your Grade :F\n”);
    }else if (marks=33){
    printf(“Your Grade:D\n”);
    }else if (marks=40){
    printf(“Your Grade:C\n”);
    }else if(marks=50){
    printf(“Your Grade:B\n”);
    } else if(marks=60){
    printf(“Your Grade:A-\n”);
    }else if(marks=70){
    printf(“Your Grade:A\n”);
    }else if(marks=80){
    printf(“Your Grade:A+\n”);
    }
    else{
    printf(“Wrong input\n Please input correct No.\n”);
    }

    return 0;
    }

  6. #include
    int main (){
    float x;
    printf(“Enter your mark : “);
    scanf(“%f”,&x);
    if (x>80 && x70&&x60&&x50&&x40&&x33&&x<=39){
    printf("\n\nYour Grade is D\n\n");
    }else if (x<=32){
    printf("\n\nYou have failed !!\n\n");
    }else printf("\n\nInvalid input\n\n");

    return 0;
    }

Leave a Reply

Your email address will not be published.