Computer Science, asked by samantaraydeepak12, 12 days ago

create an array of size 100×6to store points of 100 students in 6 subjects. Assign values with natural numbers starting from 100.Display the points secured in reverse order.


Answers

Answered by ir892
1

Answer:

// A C++ program to print elements which are

// greater than avg of array

#include <iostream>

using namespace std;

// Print array elements greater than average

void printAboveAvg(int arr[], int n)

{

// Find average

double avg = 0;

for (int i = 0; i < n; i++)

avg += arr[i];

avg = avg / n;

// Print elements greater than average

for (int i = 0; i < n; i++)

if (arr[i] > avg)

cout << arr[i] << " ";

}

// Driver program

int main()

{

int arr[] = { 5, 4, 6, 9, 10 };

int a = sizeof(arr) / sizeof(arr[0]);

printAboveAvg(arr, a);

return 0;

Similar questions