hello, i havent been programming for long... but i need to write a program that
ID: 3639048 • Letter: H
Question
hello, i havent been programming for long... but i need to write a program that read twelve temperature values and prints the month with the highest temperature.i have the loop..
double highest_value;
cin >> highest_value;
int highest_month = 1;
for (int current_month = 2; current_month <= 12; current_month++)
{
double next_value;
cin >> next_value;
{
highest_value = next_value;
highest_month = current_month;
}
}
cout << highest_month << endl;
hope his help, thank you
Explanation / Answer
#include #include int main () { int i; double highest_value[12]; double max = highest_value[0]; for (i = 0; i < 12; i++) { couthighest_value[i]; } int min = a[0]; for (i = 0; i < 12; i++) { if (highest_value[i] > max) { max = highest_value[i]; } } coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.