#include <bits/stdc++.h>
using namespace std;
int main()
{
int arr[] = {1,3,4,2,5};
int n = sizeof(arr)/sizeof(arr[0]);
sort(arr, arr+n, greater<int>());
int a;
for (a = 0; a < n; a++)
cout << arr[a] << " ";
return 0;
}
a) 1 2 3 4 5
b) 1 3 4 2 5
c) 5 4 3 2 1
d) error
What will be the output of the given C++ code?
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
What will be the output of the given C++ code?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!