Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

12 to december in c++ code

#include <iostream>
#include <string>
using namespace std;

int main()
{
    int m;
    string months[] = {"Jan", "Feb", "Mar", "Apr", "May",
                       "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
    cout << "Enter a month number: ";
    cin >> m;
    cout << "You selected " << months[m-1] << endl;
    return 0;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #december #code
ADD COMMENT
Topic
Name
9+4 =