My program is suppose to prompt user to enter a number 1-12 and output the corresponding month. Ok I know I am missing a very important part of this program but right know I am struggling to figure out what to use. Do I need to have a string that includes all the names of the months? Also I know that I need to have something to put after the cout<<"the month is"<< something has to go here so the answer will print but I not sure what right now. I also think I need at have int month= something but not sure if it should be 1-12 or monthname. Here is my edited program it was working but now it has a debug error the variable "month" is being used without being initialized. What does that mean?
#include <iostream>
#include <string>
using namespace std;
char chr;
int main()
{
int month;
cout<<"Enter a number from 1-12.";
if (month ==1)
cout<<"January";
else if (month==2)
cout<< "February";
else if (month==3)
cout<<"March";
else if (month==4)
cout<<"April";
else if (month==5)
cout<<"May";
else if (month==6)
cout<<"June";
else if (month==7)
cout<<"July";
else if (month==8)
cout<<"August";
else if (month==9)
cout<<"September";
else if (month==10)
cout<<"October";
else if (month==11)
cout<<"November";
else if (month==12)
cout<<"December";
else if (month>12)
cout<<"Sorry I need a number from 1-12."<<endl;
else if(month<=12)
cout<< "The month is "<<month;
cin>>chr;
return 0;
}