Calculate Grade Of Student Using C++

First of all, I would like to thank them for searching my article. The reason for that is so many articles but thank you so much for reading my article. Calculate Grade Of Student Using C++ We are going to know more about this very clearly through the article.

To calculate a student’s grade in C ++ programming based on his or her grades, you must ask the user to enter the marks you received in certain subjects.

To calculate student quality, first, calculate the score of all subjects and then calculate the average score. Start looking at the standards now to show the result as shown here in the following column.

Calculate Grade Of Student Using C++

Calculate Grade of Student using C++

#include<iostream>
using namespace std;
int main()
{
        int marks[5], i;
        float sum=0,avg;

        cout<<"\n Enter Marks of Student \n";
        cout<<"------------------------------------";
        cout<<"\n Hindi : ";
        cin>>marks[0];
        cout<<"\n English : ";
        cin>>marks[1];
        cout<<"\n Maths : ";
        cin>>marks[2];
        cout<<"\n History : ";
        cin>>marks[3];
        cout<<"\n Science : ";
        cin>>marks[4];

        for(i=0;i<5;i++)
        {
                sum=sum+marks[i];
        }
        cout<<"------------------------------------";
        cout<<"\n Total Marks of Student = "<<sum;
        avg=sum/5;
        cout<<"\n Average = "<<avg;
        cout<<"\n Grade   = ";

        if(avg>80)
        {
                cout<<"A";
        }
        else if(avg>60 && avg<=80)
        {
                cout<<"B";
        }
        else if(avg>40 && avg<=60)
        {
                cout<<"C";
        }
        else
        {
                cout<<"D";
        }
        return 0;
}

Read Also: How To Convert Uppercase To Lowercase In C++?

Output

Calculate Grade of Student using C++ pic

Final Words

Calculate Grade Of Student Using C++ We hope you find this article very useful. And if you liked this article, we ask you to share it with your friends and help them too.

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Deekshi. Here, I post about programming to help developers.

Share on:

Leave a Comment