C Program To Calculate Sum and Average of N Numbers without using Arrays, using For Loop

Опубликовано: 11 Март 2020
на канале: Technotip
40,738
395

http://technotip.com/7580/c-program-t...

Write a C program to calculate Sum and Average of N numbers without using Arrays and using for loop.

If limit is 5, then inside for loop we ask the user to input 5 integer values, and we add those values to the previous value present in variable sum. Simultaneously we keep incrementing the value of variable count by 1 for each iteration of for loop. Once the value of variable count is greater than the value of limit, then the control exits for loop. Immediately outside for loop we calculate the average by using the formula:

average = sum / limit;

C Programming Interview / Viva Q&A List
http://technotip.com/6378/c-programmi...

C Programming: Beginner To Advance To Expert
http://technotip.com/6086/c-programmi...


Смотрите видео C Program To Calculate Sum and Average of N Numbers without using Arrays, using For Loop онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Technotip 11 Март 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 40,738 раз и оно понравилось 395 людям.