0
Please some one help me my Teacher has give me a assignment to make a code that will print the days with their number
Example:if(a==1){cout<<"Monday";} But if I want to print Tuesday it will be printed twice for Wednesday day it should be printed thrice and so on but using loops is the condition that you have to use only loops for repetition https://code.sololearn.com/cr1Tv1NUe6ri/?ref=app
4 odpowiedzi
+ 5
// please attach your source code so community can help you ;)
0
Hi! your code example would be very useful so that we can understand where you stumbled
0
Use a dictionary with numbers as the keys and the days as the values. When you call the dictionary with the number key it will return the day value.
You don't need to loop and you don't need to make a nested conditional statement to do this. Your current problem is probably related to an error in the nested conditional logic. Drop that approach and use a dictionary instead.
0
Thanks 😊