Find the second largest number -coderinme

Second largest number

Find the second largest number in an array.
e.g 2 3 9 2 4 10 9 4 1 7 6
answer is 9

I method

#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
  int num;
  // read the number of element in array
    // size of array
    int n=num;
    // making a vector or array
   vector <int> a;
      int i;
      // read the element
    // sort in ascending order
    // print the 2nd largest
  return 0;

Second largest number
For more questionH.O.T.S

All rights reserved. No part of this Post may be copied, distributed, or transmitted in any form or by any means, without the prior written permission of the website admin, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the owner, addressed “Attention: Permissions Coordinator,” to the

A web developer(Front end and Back end), and DBA at Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me

Leave a reply:

Your email address will not be published.