Обсуждения
[CHALLENGE] avg (average) function
15 голосов
13 ответовWhy Avg output is float?
1 голос
2 ответовNumpy (avg of rows) how to shorten?
0 голосов
2 ответовdouble arr[]={5,2,7,8,11,9};
int n = sizeof(arr) / sizeof(arr[0]);
double sum = 0;
for(int i=0;i<n;i++)
{
sum+= arr[i];
}
double avg = sum / n;
cout<< "avarage ="<< avg<< endl;
return 0;
)
/*what does int n= sizeof(arr[]) /sizeof(arr[0]);
do, can someone explain that line for me*/
0 голосов
3 ответовАктуальное сегодня
Countdown Test
0 Votes
diary
1 Votes
what is empty tag
0 Votes
Could anyone fix this?
0 Votes
how do i create a code
0 Votes
Leecode?
2 Votes
Fitting
0 Votes