Computer Science, asked by swathi070804, 5 months ago

Write a c++ program to find sum of 5 subject marks ??​

Answers

Answered by asitpaul2015ap
0

Answer:

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

/* C++ Program to calculate Average of 5 subjects and find percentage */

#include<iostream>

using namespace std;

int main()

{

int mark[5], i;

float sum=0;

cout<<"\nEnter marks obtained in Physics, Chemistry, Maths, CS, English :: \n";

for(i=0; i<5; i++)

{

cout<<"\nEnter mark[ "<<i+1<<" ] :: ";

cin>>mark[i];

sum=sum+mark[i];

}

float avg=sum/5;

float perc;

perc=(sum/500)*100;

cout<<"\nAverage Marks of 5 Subjects = [ "<<avg<<" ] \n";

cout<<"\nPercentage in 5 Subjects = [ "<<perc<<"% ] \n";

return 0;

}

Similar questions