A PHP Error was encountered

Severity: 8192

Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

Filename: libraries/Filtered_db.php

Line Number: 23

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

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

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)

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now