Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120539888
exercise01-6.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jul 5, 02:34
Size
678 B
Mime Type
text/x-c
Expires
Mon, Jul 7, 02:34 (2 d)
Engine
blob
Format
Raw Data
Handle
27198989
Attached To
R1106 Programming Concept Rouaze
exercise01-6.cpp
View Options
/*
* exercise-template.cpp <--- The name of the source file goes here
*
* <--- Description of the program goes here.
*
* Created on: September 02, 2015 <--- Fill in the date here
* Author: Davide Forti <davide.forti@epfl.ch> <--- Fill in your name (and e-mail) here
*/
/*
* Any headers you need to include should be specified on the next lines
*/
#include <iostream>
#include <cmath>
int main(int argc, char* argv[])
{
int D[5] = {34, 58, 57, 32, 43};
int L = sizeof(D)/sizeof(*D);
int sum;
double mean;
for (int i=0; i<L; i++)
{
sum += D[i];
}
mean = double(sum)/double(L);
std::cout << "The average of theses number is " << mean << ". \n";
}
Event Timeline
Log In to Comment