0
(day_of_week) { case 1: case 2: case 3: case 4: case 5: document.write("Working Days"); ; case 6:
(day_of_week) { case 1: case 2: case 3: case 4: case 5: document.write("Working Days"); ; case 6: document.write("Saturday"); ; default: document.write("Today is Sunday"); break; } Well done!
4 ответов
+ 6
ADITI NIGAM
Well that is one of the strangest codes I have seen.
I am assuming it doesn't work, but I could be wrong.
Could you specify which language you are using, and some details of what you are trying to achieve.
IE: example input will produce example output
+ 5
Hi Aditi
Let me tell you that it is wrong
You may write in this way
switch (day_of_week)
{
case 1 :
case 2 :
case 3 :
case 4 :
case 5 :
document.write("Working days");
break;
case 6 :
document.write("Saturday");
break;
default :
document.write("Today is Sunday");
}
+ 4
Please take a look at the forum rules:
https://www.sololearn.com/Content-Creation-Guidelines/
https://www.sololearn.com/Discuss/1316935/?ref=app
Take a look at these guides on how to ask a question.
https://stackoverflow.com/help/how-to-ask
https://www.sololearn.com/blog/38/8-simple-rules-to-get-help-from-the-community
Please always tag the language you're asking about.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
- 1
document.write("saturday") ;
break; is not correct
also
//console.log nice profile picture :)