I am recently new to C++ and I wondered if someone could show me how to modify my program below. I want the program to test if there is more than 1 day that has the highest rainfall and susequently to output those corresponding days. Than you :)
#include <iostream>
#include <conio.h>
#include <iomanip>
using namespace std;
double rain[] = {18.0, 18.0, 3.2, 12.1, 14.6, 17.8, 3.2};
int main ()
{
double rainiestValue (0.0);
int rainyDayNo (-1);
for (int dayNo ( 0); dayNo < 7; ++dayNo)
if (rainiestValue < rain [dayNo])
{
rainiestValue = rain [dayNo];
rainyDayNo = dayNo;
}
cout << fixed << setprecision (2);
cout << "\nThe highest rainfall is: " << rainiestValue << "mm" << " on day " << rainyDayNo;
while (!_kbhit());
return 0;
}