apnk
Headphoneus Supremus
- Joined
- May 20, 2004
- Posts
- 3,596
- Likes
- 11
Any computer programmers here? C++ language. I have a question. Dont laugh if its dumb, i am just a beginner
.
Ok for some reason when i run this program the second CIN (its in bold) is skipped, it doesn't ask me to enter the amount of rainfall, it goes straight to the average.
Tell me whats wrong!!! Thanks!
__________________________________________________ ___________
#include <iostream>
using namespace std;
int main ()
{
int mth1, mth2, mth3; // months
float rain1, rain2, rain3; // rainfall
float average;
cout << "Enter the three months, in order to find an average: ";
cin >> mth1, mth2, mth3;
cout << "\nNow enter the rainfall for each month: \n";
cin >> rain1, rain2, rain3;
average = (rain1 + rain2 + rain3) / 3;
cout << "\n\nThe average rainfall is" << average << endl;
return 0;
}
Ok for some reason when i run this program the second CIN (its in bold) is skipped, it doesn't ask me to enter the amount of rainfall, it goes straight to the average.
Tell me whats wrong!!! Thanks!
__________________________________________________ ___________
#include <iostream>
using namespace std;
int main ()
{
int mth1, mth2, mth3; // months
float rain1, rain2, rain3; // rainfall
float average;
cout << "Enter the three months, in order to find an average: ";
cin >> mth1, mth2, mth3;
cout << "\nNow enter the rainfall for each month: \n";
cin >> rain1, rain2, rain3;
average = (rain1 + rain2 + rain3) / 3;
cout << "\n\nThe average rainfall is" << average << endl;
return 0;
}