+ 3
How to make a c++ program for average of n numbers?
by using loop , while loop ,for loop etc
7 Answers
+ 9
I agree with Mr. Wells.
But as an ad-hoc example play with this UGLY code to get the point.
https://code.sololearn.com/cZPq0D7kg8g5
+ 9
Don't worry Luka. He will figure out soon. ;)
+ 4
Depends on how you get the numbers. If you are reading them from console or file, a while loop would be used to get them and you can sum their values and count how many during that loop. If they are predefined in an array, a for loop makes sense.
+ 4
I could, but you need to learn how to do it yourself. It isn't that hard and, if you fail to get it to compile or run, post it here. I or someone else we explain how to fix it.
+ 2
thanks sir,can u please send me the example