Q:

C++ Program For Calculate Percentage Of More Than 6 Subjects

belongs to collection: Simple Programs in C++ Programming

0

C++ Program For Calculate Total Marks Of  more than 6 Subjects And percentage and you need to calculate the percentage of marks and also print the marks of each subject.


Logic:-

First we will ask the user for the total number of the subject after that we will enter marks of all those subjects. Now we will calculate a percentage of marks and print student marks, percentage, and Grade of Student  Percentage formula is given Below.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include<iostream>
using namespace std;
int main()
{
   int sub,marks,n,i,sum=0,tmp=0,arr[10],Percentage;

   cout<<"\nEnter number of subject : \n";
   cin>>n;
   
   tmp=n*100;
   
   cout<<"\nEnter The Marks: \n";
   for(i=0;i<n;i++)
   {
    cin>>arr[i];
   }
   for(i=0;i<n;i++)
   {
    sum=sum+arr[i];
   } 
   
   Percentage = ( sum * 100 ) / tmp;
   
   cout<<"\nPercentage Of Student : \n"<< Percentage<<endl;

   return (0);
}

 

Output:

Enter number of subject : 

7

Enter The Marks: 

74

82

56

92

67

81

75

Percentage Of Student : 

75

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C++ Program For Converting Temperature Celsius Int... >>
<< C++ Program For Find The Gross Salary Of An Employ...