Write a C++ program in which using loop and print 7 days of 3 weeks
Answers
Answered by
1
Answer:
#include <iostream>
#include "conio.h"
using namespace std;
void main() {
int day;
cout << "Enter a number between 1 to 7: ";
cin >> day;
switch(day)
{
case 1:
cout << "Monday" << endl;
break;
case 2:
cout << "Tuesday" << endl;
break;
case 3:
cout << "Wednesday" << endl;
break;
case 4:
cout << "Thursday" << endl;
break;
case 5:
cout << "Friday" << endl;
break;
case 6:
cout << "Saturday" << endl;W break;
case 7:
cout << "Sunday" << endl;
break;
default:
cout << "Number entered is invalid" << endl;
}
getch();
}
OUTPUT:-
Enter a number between 1 to 7: 3
Wednesday.
Similar questions