Write an algorithm to enter marks of three subject for 100 students and find average and percentage if age is greater than 20 and less than 25

1. Start the algorithm.

2. Initialize variables for total marks, average, percentage, and count of students satisfying the age criteria.
3. Set the count variable to 0.
4. Repeat steps 5-11 for each student (outer loop).
5. Prompt the user to enter the age of the student.
6. If the age is greater than 20 and less than 25, proceed with entering the marks. Otherwise, skip steps 7-11 and go to step 12.
7. Initialize variables for subject 1 marks, subject 2 marks, and subject 3 marks.
8. Prompt the user to enter the marks for subject 1.
9. Prompt the user to enter the marks for subject 2.
10. Prompt the user to enter the marks for subject 3.
11. Calculate the total marks for the student and increment the count variable by 1.
12. Continue to the next student (end of outer loop).
13. If the count is greater than 0, proceed with calculating the average and percentage. Otherwise, display a message indicating no students satisfying the age criteria.
14. Calculate the average by dividing the total marks by the count of students.
15. Calculate the percentage by dividing the average by the maximum marks (assuming 100%) and multiplying by 100.
16. Display the average and percentage to the user.
17. End the algorithm.

To write an algorithm for entering marks of three subjects for 100 students and finding the average and percentage if their age is between 20 and 25, you can follow these steps:

1. Initialize variables:
- total_students = 100
- marks = 3 (assuming three subjects)
- subject1, subject2, subject3 = 0 (initializing marks for each subject)
- sum_marks = 0 (to store the sum of marks)
- count_students = 0 (to count the number of students within the age range)
- avg_marks = 0 (to store the average marks)
- percentage = 0 (to store the percentage)

2. Start a loop to enter marks for each student:
- For i = 1 to total_students:
- Input age for student i
- If age is greater than 20 and less than 25:
- Input marks for subject1, subject2, subject3 for student i
- Compute sum_marks = sum_marks + subject1 + subject2 + subject3
- Increment count_students by 1

3. Calculate average and percentage:
- If count_students > 0:
- avg_marks = sum_marks / (count_students * marks)
- percentage = (sum_marks / (total_students * marks * 100)) * 100

4. Display average and percentage:
- Display avg_marks
- Display percentage

This algorithm allows you to enter marks for three subjects for 100 students and calculates the average and percentage only for the students whose age is within the specified range (20-25).