Find the sum or average of array values (C++ programming tutorial)

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

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

  • @MoonV29
    @MoonV29 6 лет назад +10

    Thank you for this, fast and clear explanation. Easy for a slow student like me.

    • @Engineer4Free
      @Engineer4Free  6 лет назад +2

      Glad to hear it, thanks for the comment! Do check out my whole playlist at engineer4free.com/cplusplus if you haven't already!

  • @konehnorbert6300
    @konehnorbert6300 3 года назад +2

    thanks man.. soo cool n straight forward

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

      You're welcome!! There is more here: engineer4free.com/cplusplus =)

  • @mr1025
    @mr1025 4 года назад +1

    thank so much!!!!! so simple, ez explaination

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

    Thank you

  • @huzaifak_08
    @huzaifak_08 4 года назад +1

    Sir kindly tell me the name of the compiler you are using on your macbook.

    • @Engineer4Free
      @Engineer4Free  4 года назад +1

      I'm using Xcode in this video

    • @huzaifak_08
      @huzaifak_08 4 года назад

      @@Engineer4Free sir kindly suggest me latest complier for C++ and one for Java that runs on a macbook air

  • @Nevermind-yk6cc
    @Nevermind-yk6cc 4 года назад +1

    But how to find the average if the numbers are negative

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

    Question, so I have to do this for an array that is read from data files (6.82 6.18 7.56) how would I do that since the array values isn’t hard coded

  • @figarofreeman1385
    @figarofreeman1385 5 лет назад +1

    is there anywhere in your videos where u explained the definition of a prototype function?

    • @figarofreeman1385
      @figarofreeman1385 5 лет назад +1

      sorry to disturb u yes there is.

    • @Engineer4Free
      @Engineer4Free  5 лет назад

      Yeah no worries! I believe that you are looking for video number 29 here: engineer4free.com/cplusplus

  • @GlamourDees94
    @GlamourDees94 7 лет назад +1

    Can I put the average loop into a user defined function? And when I call it what should I put as the parameters?
    Thanks !
    I'm a beginner

  • @rareminerals
    @rareminerals 4 года назад +1

    Which IDE is that?

  • @Faikaizen
    @Faikaizen 5 лет назад

    What if the number of the times that the loop runs varies, how do you find the number of time that the loop runs so you can divide the sum by that number to find the average. Please give me a hint. Thank you!!!!!

    • @Engineer4Free
      @Engineer4Free  5 лет назад +1

      umm maybe you could put an integer inside that increments each time it loops, and then just check the value of the integer at the end to see how many times it ran or use that in average calculation. Not sure if we're thinking about the same thing tho

    • @Faikaizen
      @Faikaizen 5 лет назад

      @@Engineer4Free Thank you very much for replying. I greatly appreciate it. 👍Good luck with your channel!!!!!

  • @user-hj6kf8wc5c
    @user-hj6kf8wc5c 4 года назад

    im trying to do this but my array is using user input so I don't specifically know how large the array will be...
    got any ideas.

    • @tsireledzogiven7642
      @tsireledzogiven7642 3 года назад

      U can initialize variable size then ask user to enter size then use size on ur for loop instead of a known value. Eg) for (int i= 0; i > size; i++).

    • @user-hj6kf8wc5c
      @user-hj6kf8wc5c 3 года назад

      @@tsireledzogiven7642 well i turned in that project 8 months ago but thanks anyway lol

  • @aceforceina4039
    @aceforceina4039 6 лет назад +1

    what is the program used for this?

    • @Engineer4Free
      @Engineer4Free  6 лет назад +2

      Xcode. You can find a list of all of the hardware and software that I use for the videos here: engineer4free.com/tools

    • @aceforceina4039
      @aceforceina4039 6 лет назад +1

      Thanks! didn't expect for you guys to be still active

    • @Engineer4Free
      @Engineer4Free  6 лет назад

      Yup, still trucking along ^_^

  • @figarofreeman1385
    @figarofreeman1385 5 лет назад

    God bless, use full video

  • @mariopersaud6703
    @mariopersaud6703 5 лет назад

    can we do this if its reading from a txt file?

    • @Engineer4Free
      @Engineer4Free  5 лет назад

      Yeah but I don't have any videos on reading .txt files sorry. It's been a long time since I worked with them.

  • @MuhammadAli-lt5db
    @MuhammadAli-lt5db 7 лет назад

    thanks ...

  • @figarofreeman1385
    @figarofreeman1385 5 лет назад +1

    sup bro, what does i ++ mean ?

    • @Engineer4Free
      @Engineer4Free  5 лет назад +1

      Hey i is the name of an integer variable that we are using as a counter whose value is incremented by one for each iteration of the loop. ++ is the operator that simply adds one to the value on each iteration. You need to at least watch videos 21-25 here: engineer4free.com/cplusplus and then once you understand loops and increment it them then watch videos 34-40 for more content on particular.

    • @figarofreeman1385
      @figarofreeman1385 5 лет назад

      okay