Thursday, June 3, 2021

C++ program enter a number and check the day of a weak (POP) (107)

#include<iostream>

using namespace std;

int main()

{

int num;

cout<<"please enter any number:";

cin>>num;

switch(num)

{

case 1:

cout<<"monday";

break;

case 2:

cout<<"tuesday";

break;

case 3:

cout<<"wednessday";

break;

case 4:

cout<<"thrusday";

break;

case 5:

cout<<"friday";

break;

case 6:

cout<<"saturday";

break;

case 7:

cout<<"sunday";

break;

default:

cout<<"a week has only seven day:";

break;

}

} 

No comments:

Post a Comment