Q&A Discussies
[CHALLENGE] avg (average) function
15 Stemmen
13 AntwoordenSql
0 Stemmen
4 AntwoordenSQL
0 Stemmen
5 Antwoordendouble 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 Stemmen
3 AntwoordenPopulair vandaag
Text editor
0 Votes
Debugging issue?
0 Votes
how to view only application
0 Votes
Arduino
2 Votes
Iām really confused
0 Votes
Scraping
0 Votes
Stream
0 Votes
Java Advanced Module
0 Votes