Odpowiedź :
Średnia tych elementów to 4,58333...(...)
7,6,3,4,6,1,1,8,5,8,4,2 iż gdyż to wszystko trzeba pododawać i podzelić przez 12.
7,6,3,4,6,1,1,8,5,8,4,2 iż gdyż to wszystko trzeba pododawać i podzelić przez 12.
//Program napisany w dev c++ (darmowy kompilator)
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
main()
{
float suma=0,srednia;
int T[12]={7,6,3,4,6,1,1,8,5,8,4,2};
for (int i=0;i<=11;i++)
{
suma=suma+T[i];
}
srednia=suma/12;
cout << "Srednia tych elemntow wynosi: " << srednia;
getch();
return 0;
}
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
main()
{
float suma=0,srednia;
int T[12]={7,6,3,4,6,1,1,8,5,8,4,2};
for (int i=0;i<=11;i++)
{
suma=suma+T[i];
}
srednia=suma/12;
cout << "Srednia tych elemntow wynosi: " << srednia;
getch();
return 0;
}
7,6,3,4,6,1,1,8,5,8,4,2 wszystko trzeba pododawać i podzelić przez 12.
średnia: 4,58333..(...)