-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudents Marks.cpp
More file actions
38 lines (33 loc) · 824 Bytes
/
Students Marks.cpp
File metadata and controls
38 lines (33 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include<iostream>
using namespace std;
int main()
{
int n,sum=0;
cout<<"enter number of students ";
cin>>n;
int students[n];
for(int i=0; i<n; i++)
{
cout<<"number of student(" << i+1 << ") "; //students[i]=students mark
cin >>students[i];//students[i]=students mark
sum = sum+students[i];//students[i]=students mark
}
float avg=(float)sum/n;
cout<<"total marks "<<sum<<endl;
cout<<"avarage marks "<<avg<<endl;
int max=students[0];
int min=students[0];
for(int i=1; i<n; i++)
{
if(max<students[i])
{
max= students[i];
}
if(min>students[i])
{
min= students[i];
}
}
cout<<"maximum number"<<max<<endl;
cout<<"minimum number"<<min<<endl;
}