hi this is my code, and error says - syntax error: missing ";" before identifier "endl", at the last cout line, and also - function call missing argument list at the same spot.
#include <iostream>
#include <string>
using namespace std;
const string JAN = "January.";
const string FEB = "February.";
const string MAR = "March.";
const string APR = "April.";
const string MAY = "May.";
const string JUNE = "June.";
const string JULY = "July.";
const string AUG = "August.";
const string SEPT = "September.";
const string OCT = "October.";
const string NOV = "November.";
const string DEC = "December.";
int main()
{
int day1;
cout << "Please enter a number between 1 and 366: ";
cin >> day1 >> endl;
cout << "If you entered ";
if (day1 > 0 && day1 <= 31)
{
cout << "the month is " << JAN << endl;
}
else
if (day1 > 31 && day1 <= 61)
{
cout << "the month is " << FEB << endl;
}
else
if (day1 > 61 && day1 <= 92)
{
cout << "the month is " << MAR << endl;
}
else
if (day1 > 92 && day1 <= 122)
{
cout << "the month is " << APR << endl;
}
else
if (day1 > 122 && day1 <= 153)
{
cout << "the month is " << MAY << endl;
}
else
if (day1 > 153 && day1 <= 183)
{
cout << "the month is " << JUNE << endl;
}
else
if (day1 > 183 && day1 <= 214)
{
cout << "the month is " << JULY << endl;
}
else
if (day1 > 214 && day1 <= 244)
{
cout << "the month is " << AUG << endl;
}
else
if (day1 > 244 && day1 <= 275)
{
cout << "the month is " << SEPT << endl;
}
else
if (day1 > 275 && day1 <= 305)
{
cout << "the month is " << OCT << endl;
}
else
if (day1 > 305 && day1 <= 336)
{
cout << "the month is " << NOV << endl;
}
else
if (day1 > 336 && day1 <= 366)
{
cout << "the month is " << DEC << endl; }
else
{
cout << "you entered an invalid number."endl;
}