Why does C++ require breaks in switch statements? - Stack Overflow

PHOTO EMBED

Tue Nov 15 2022 00:57:30 GMT+0000 (Coordinated Universal Time)

Saved by @leawoliu #cpp

switch (month) {
 case 2:
   if(isLeapYear)
    days = 29;  
   else
    days = 28;
    break;
  case 4:
  case 6:
  case 9:    // do the same thing
  case 11:
    days = 30;
     break;
  default:
    days = 31;
 }
content_copyCOPY

https://stackoverflow.com/questions/29915854/why-does-c-require-breaks-in-switch-statements