Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- // Программа считает среднее арифметическое 10 вещественных чисел и выводит результат на экран
- int main( void ){
- float numbers[] = {2.5, 4.6, 2.6, 12.5, 34.34, 65.7, 21.3, 6.7, 45.3, 3.5};
- int i;
- float sum = 0;
- for ( i = 0; i < 10; i++ )
- sum += numbers[i];
- printf( "%f", sum /= 10 );
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment