Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- int main()
- {
- const int Size = 50;
- int UserSizeArray = 0;
- double Sum = 0;
- double Result = 0;
- int NumberToDevide = 0;
- int Less = 0, Greater = 0;
- cout << "Enter the size of the array :" << endl;
- cin >> UserSizeArray;
- int MyArray[Size];
- cout << "Enter how many elements of the array :" << endl;
- for (int i = 0; i < UserSizeArray; i++)
- {
- cin >> MyArray[i];
- NumberToDevide++;
- }
- for (int i = 0; i < UserSizeArray; i++)
- {
- Sum = Sum + MyArray[i];
- }
- Result = (Sum / NumberToDevide); // The Answer of The sum Array
- for (int i = 0; i < UserSizeArray; i++)
- {
- if (MyArray[i] < Result)
- {
- Less++;
- }
- else
- {
- Greater++;
- }
- }
- cout << "The Avarage Sum of the array is : " << Result << endl;
- cout << "The numbers of values less than : " << Result << " Is : " << Less << endl;
- cout << "The numbers of values greater than : " << Result << " Is : " << Greater << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement