65 698
Assignments Done
99,2%
Successfully Done
In October 2018

Answer to Question #39167 in C++ for prakash

Question #39167
wap to find out average temperature of the week.
Expert's answer
#include <iostream>

using namespace std;

const char* const days[]={"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

int main () {
int temperature = 0;
int i, t;

for ( i = 0; i < 7; i++) {
cout << "Enter temperature for "
<< days [i]
<< " :";
cin >> t;
temperature += t;
}
cout << "Average: "
<< temperature / 7;
<< endl;
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions