Site icon T4Tutorials.com

Switch statement program to find weekday

Let us see the Switch statement program to find a weekday.

Flowchart of the program to find weekday

Switch statement program Source Code to find weekday from day number

#include<iostream>
using namespace std;
int main()
{
	int a;
	cout<<"Enter No. of Days (1-7) ";
	cin>>a;
	switch(a)
	{
		case 1:
			cout<<"Its Monday";
			break;
		case 2:
			cout<<"Its tuesday";
		break;
		case 3:
			cout<<"Its wednesday";
		break;
		case 4:
			cout<<"Its thusday";
		break;
		case 5:
			cout<<"It's Friday";
		break;
		case 6:
			cout<<"Its saturday";
		break;
		case 7:
			cout<<"Its sunday";
		break;		
	}
}
		
	

Output

Enter No. of Days (1-7)

5

It’s Friday

SFT (Shamil’s Flow Table )

Are you interested to Read about SFT(Shamil’s Flow Table)?

Exit mobile version