Find the max element along with it's index in c++
int main() { int num, arr[10]; int x, y, a, b; cin >> num; for (int i = 0; i < num; i++) { cin >> arr[i]; } cout << "Max element Index: " << max_element(arr, arr + num) - arr; return 0; }
Find the max element along with it's index in c++
int main() { int num, arr[10]; int x, y, a, b; cin >> num; for (int i = 0; i < num; i++) { cin >> arr[i]; } cout << "Max element Index: " << max_element(arr, arr + num) - arr; return 0; }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us