Write a program that takes 4 numbers from user as input and decide which one is smaller which one greater which one middle1 and which one is middle 2 and print in sequence (c++)
Answers
Answered by
0
Answer:
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
int main() {
int arr[4];
for (int i = 1; i <= 4; i++) {
cout << "Enter number: ";
cin >> arr[i - 1];
}
sort(arr, arr + 4, greater<int>());
cout << "Array after sorting" << endl;
for (int i = 0; i < 4; i++) {
cout << arr[i] << endl;
}
return 0;
}
Explanation:
Please mark it as the brainliest
Similar questions