title: Switch Case Assignment, none of my cases are providing an output
body: <p>Hi we were assigned to make a program that would ask the user to input a 4 digit decimal and the program was supposed to convert it to its roman numeral equivalent. We were tasked to only use the switch case function and nothing else. I thought I had the right idea but the problem with my code is it doesn't provide an output. Below is my code, help, pointers and advice would be greatly appreciated</p>
  
  <pre><code>int num, A, B, C, D;    
  
  printf("enter a number: ");
  scanf("%d", &amp;num);
  
  D = num%10;
  C = ((num%100)/10);
  B = ((num%1000)/100);
  A = (num/1000);
  
  if(0&lt;num&amp;&amp;num&lt;3001)
  {
  
      switch(A)
      {
  
            case '1'  : printf("M");
                        break;
            case '2'  : printf("MM");
                        break;
            case '3'  : printf("MMM"); 
                        break;    
      }
  
      switch(B)
      {
             B = ((num%1000)/100);
  
             case '1'  : printf("C");
                         break;
             case '2'  : printf("CC");
                         break;
             case '3'  : printf("CCC");
                         break;
             case '4'  : printf("CD");
                         break;
             case '5'  : printf("D");
                         break;
             case '6'  : printf("DC");
                         break;
             case '7'  : printf("DCC");
                         break;
             case '8'  : printf("DCCC");
                         break;
             case '9'  : printf("CM");
                         break;
             }
  
      switch(C)
      {
             C = ((num%100)/10);
  
             case '1'  : printf("X");
                         break;
             case '2'  : printf("XX");
                         break;
             case '3'  : printf("XXX");
                         break;
             case '4'  : printf("XL");
                         break;
             case '5'  : printf("L");
                         break;
             case '6'  : printf("LI");
                         break;
             case '7'  : printf("LII");
                         break;
             case '8'  : printf("LIII");
                         break;
             case '9'  : printf("XC");
                         break; 
      }
  
      switch(D)
      {
             D = num%10;
  
             case '1' : printf("I");
                        break;
             case '2' : printf("II");
                        break;
             case '3' : printf("III");
                        break; 
             case '4' : printf("IV");
                        break;
             case '5' : printf("V");
                        break;
             case '6' : printf("VI");
                        break;
             case '7' : printf("VII");
                        break;
             case '8' : printf("VIII");
                        break;
             case '9' : printf("IX");
                        break;      
      }  
  }            
  
  else
      printf("number out of bounds");
  </code></pre>