Answer to Question #3355 in C++ for mukunda

Question #3355
Write a program that prints week days.
1
Expert's answer
2011-07-21T08:07:12-0400
#include <iostream>
using namespace std;

int main()
{
for (int i = 0; i < 7; ++i) {
switch (i) {
case 0: cout << "Sunday"; break;
case 1: cout << "Monday"; break;
case 2: cout << "Tuesday"; break;
case 3: cout << "Wednesday"; break;
case 4: cout << "Thursday"; break;
case 5: cout << "Friday"; break;
case 6: cout << "Saturday"; break;
}
cout << endl;
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS