Display division of student according to marks in C++ - 👑 सार्थक मुंड S3 🤴🏻

Display division of student according to marks in C++

Display division of student in C++

Write a program (WAP) in C++ to display the division/grade of student according to the given mark(if...else if).

#include<iostream.h>
#include<conio.h>
void main()
{
int n, i;
float marks[10], per=0, total=0;
clrscr();
cout<<"Enter number of subject:\n ";
cin>>n;
cout<<"Enter marks of "<<n<<" subject:\n ";
for(i=0; i<n; i++)
{
cin>>marks[i];
}
for(i=0; i<n; i++)
{
total=total+marks[i];
}
per=total/n;
cout<<"Percentage: "<<per<<" %" <<endl;
if(per>=90) {
cout<<"Grade A";
}
else if(per<90 && per>=70)
{
cout<<"Grade B";
}
else if(per<70 && per>=50)
{
cout<<"Grade C";
}
else if(per<50 && per>=30)
{
cout<<"Grade D";
}
else
{
cout<<"Fail";
}
getch();
}
 Display division of student in C++

Must Read :-

  1. Blogger Tutorial
  2. C Programs
  3. C++ Programs
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes 
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads