Merubah Format Tanggal dalam C++

Seperti postingan sebelumnya, saya akan memeberi tau bagaimana merubah format tanggal dalam C++"



#include

int main ()


{

int day, month, year;
char line;

cout << "Input a date as dd/mm/yy: ";
cin >> day >> line >> month >> line >> year;

switch (month) {

case 1: cout << "January";break;
case 2: cout << "February";break;
case 3: cout << "March";break;
case 4: cout << "April";break;
case 5: cout << "May"; break;
case 6: cout << "June"; break;
case 7: cout << "July"; break;
case 8: cout << "August"; break;
case 9: cout << "September";break;
case 10:cout << "October"; break;
case 11:cout << "November"; break;
case 12:cout << "December"; break;

}
cout <<" " << day << ", " << year;

}

sekian, semoga bermanfaat

Share this:

CONVERSATION

0 komentar:

Posting Komentar