Back to Browse

C++ Program to Find Highest and Lowest Grades in an Array

10 views
May 22, 2026
8:47

#include <iostream> using namespace std; int main() { const int size = 30; int arr[size]; // Enter Elements for (int i = 0; i < size; i++) { cout << "Enter Array [" << i + 1 << "]: " << endl; cin >> arr[i]; } // Max Element int max = arr[0]; for (int i = 0; i < size; i++) { if (arr[i] > max) { max = arr[i]; } } // Min Element int min = arr[0]; for (int i = 0; i < size; i++) { if (arr[i] < min) { min = arr[i]; } } cout << "Max = " << max << endl; cout << "Min = " << min << endl; return 0; }

Download

1 formats

Video Formats

360pmp46.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

C++ Program to Find Highest and Lowest Grades in an Array | NatokHD