Question: *** write down in words what this program does ? #include using namespace std; int main() { int len; cout < < Enter a number:
*** write down in words what this program does ?
#include
using namespace std; int main() { int len; cout << "Enter a number: "; cin >> len; for (int i = 0; i < len; i++) { for (int j = i+1; j < len; j++) { cout << " "; } cout << "#" << endl; } } --------------------------------------------------------------------------
** Assume weekday has been previously declared as an int and given a meaningful value. Write a switch statement that for any value of weekday, produces exactly the same output as the following if statement.
if (weekday == 1) cout << "rainy days and mondays get me down"; else if (weekday == 2) cout << "ruby tuesday"; else if (weekday == 6 || weekday == 7) cout << "wonderful weekend"; else cout << "regular day";
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
