Write a C++ program that will accept the marks in a test for a group of 25 students then calculate and

display the average mark and highest marks in class.

#include<iostream>

#include<c.string>
using namespace std;
int main()
{
int arr[25];
string name[25];
for (int i=0;i<25;i++)
{
cout<<"the name"<<endl;
cin>>name[i];
cout<<"marks"<<ndl;
cin>>arr[i];
}
int sum=0;int avg;
for(inti=0;i<25;i++)
{
sum=sum+arr[i];
}
avg=sum/25;
int max=a[0];
for (int i=0; i<25;i++)
{
if (max<a[i])
max=a[i];
}
cout<<"Class average is: "<<avg<<endl;
cout<<"highest marks are: "<<max<<endl;
return 0;
}

To write a C++ program that accepts the marks for a group of 25 students and calculates the average mark and highest mark in the class, follow the steps below:

1. Declare an array of size 25 to store the marks for each student.
2. Prompt the user to enter the marks for each of the 25 students.
3. Use a loop to store the entered marks in the array.
4. Initialize variables `sum` and `highestMark` to 0.
5. Iterate over the array and update the sum variable by adding each mark to it.
6. Compare each mark with the current highestMark and update highestMark if the mark is greater.
7. Calculate the average mark by dividing the sum by the number of students (25 in this case).
8. Print the average mark and highest mark to the console.

Here's the C++ code that implements the above steps:

```cpp
#include <iostream>

int main() {
int marks[25];
int sum = 0;
int highestMark = 0;

// Accept marks for 25 students
for (int i = 0; i < 25; i++) {
std::cout << "Enter the mark for student " << i + 1 << ": ";
std::cin >> marks[i];

// Update the sum
sum += marks[i];

// Update the highest mark
if (marks[i] > highestMark) {
highestMark = marks[i];
}
}

// Calculate the average mark
double averageMark = static_cast<double>(sum) / 25;

// Display the average mark and highest mark
std::cout << "Average Mark: " << averageMark << std::endl;
std::cout << "Highest Mark: " << highestMark << std::endl;

return 0;
}
```

When you run this program, it will prompt you to enter the marks for each student. After entering all the marks, it will calculate and display the average mark and highest mark in the class.