Find The Second Highest Number In An Array | C Programming Example

Поделиться
HTML-код
  • Опубликовано: 19 окт 2024

Комментарии • 41

  • @mb59621
    @mb59621 4 месяца назад +4

    Sir , doesnt this approach fail if the highest no. occurs twice in the array in 0 and 1 indexes ?

  • @hrishikeshkashyap3715
    @hrishikeshkashyap3715 5 месяцев назад

    Why do we need the "else if(a[i]>max2 && a[i]

  • @BebekKecap
    @BebekKecap 10 месяцев назад +4

    Hey May I know why do we need to find the first highest and second highest number? Can't we just set both max1 and max2 to a[0] initially?

    • @captainclawster1529
      @captainclawster1529 10 месяцев назад

      Are u dumb ?

    • @Deadman1070
      @Deadman1070 8 месяцев назад

      cause we are trying to find second highest number here so we gotta keep record of the second highest value. if we would set both to a[0] we would only know highest value

  • @GigaChad-zx9hj
    @GigaChad-zx9hj Год назад +2

    You made it look so easy thanks man..

  • @CalistheniVijay
    @CalistheniVijay Год назад +1

    Thank man it's so easy after watching your video 😊

    • @PortfolioCourses
      @PortfolioCourses  Год назад

      You’re very welcome, I’m glad to hear the video was helpful! :-)

  • @stacyhackney6872
    @stacyhackney6872 2 года назад +2

    thank you sincerely

  • @bisanal-ghoul3389
    @bisanal-ghoul3389 2 года назад +3

    Great explanation!! It would be better if u should an example on an unsorted array, and another example on what happens when a number is less than max1 but bigger than max2

  • @gauravsolanki1103
    @gauravsolanki1103 Год назад +1

    fantastic explaination

  • @ece_073diptabh_medhi2
    @ece_073diptabh_medhi2 2 года назад +1

    thank you so much this video helped me a lot :D

  • @markopolo2224
    @markopolo2224 2 года назад +1

    thank you so much

  • @obrenvukasovic7137
    @obrenvukasovic7137 4 месяца назад

    what if user input numbers?Is it same?

  • @ayansiyam9782
    @ayansiyam9782 Год назад

    very easy thanks

  • @heytanibhi
    @heytanibhi Год назад

    Thankyou so much sirrrrrr

  • @MovieZ1p
    @MovieZ1p Год назад

    Good work

  • @bhimambikakittali8655
    @bhimambikakittali8655 Год назад

    Nice logic

  • @gol.danime
    @gol.danime 4 месяца назад

    in for loop the i should be initialize to 0 and not 2.

    • @PortfolioCourses
      @PortfolioCourses  4 месяца назад +1

      No, because the first two elements are already accounted for.

    • @gol.danime
      @gol.danime 4 месяца назад

      ​@@PortfolioCourses yes ur right...🙌

  • @toxicwall6593
    @toxicwall6593 Год назад

    Is this applicable to Cplushplush?

    • @PortfolioCourses
      @PortfolioCourses  Год назад

      Yes, I would say so, it should work the same way in C++ too. :-) That said you may want to use cout for output instead of printf, using printf in a C++ program is a bit unusual.

  • @ShivamKumar-rz7uv
    @ShivamKumar-rz7uv 2 года назад

    Bahi questions largest two in array in c ?

  • @rakurame6990
    @rakurame6990 3 года назад +1

    👌

  • @ryanalnaser914
    @ryanalnaser914 2 года назад

    whatever I do or did or anything or know or did not know and whatever I do or why and I will see more like whatever