title: what if we use Default first in switch case in c
body: <p>Here if i run the code every case is getting printed and it is not happening if i put the default at the end can you please give me a clarification why it is happening so?
  Thank u so much in advance for spending time at my question.</p>
  <p>enter code here</p>
  <pre><code>   #include &lt;stdio.h&gt;
  
     int main()
     {
  
       int weekday=8;
  
      switch (weekday)
    {
       
   default:
      
    printf(&quot;\n Please enter Valid Number between 1 to 7&quot;);     
   
   case 1:
        
    printf(&quot;\n Today is Monday&quot;);
        
    case 2:
        printf(&quot;\n Today is Tuesday&quot;);
        
    case 3:
        printf(&quot;\n Today is Wednesday&quot;); 
        
    case 4:
        printf(&quot;\n Today is Thursday&quot;); 
        
    case 5:
        printf(&quot;\n Today is Friday&quot;); 
        
    case 6:
        printf(&quot;\n Today is Saturday&quot;);
        
    case 7:
        printf(&quot;\n Today is Sunday&quot;);
        
  
     }
  
     printf(&quot;\n%d&quot;,weekday);
    
  return 0;
   }
  </code></pre>