Taking a 2 or more digit number as char in c : i have to write a program which i take a number as a character then find its binary so i used this code 


[screenshotofmycode][1]



but it only works for numbers from 0 to 9.. it should work on 2 or more digit numbers.
I have to take the number as char because the user might enter the number in base 16 and i have to ask the number first then the basetype.... we are not allowed to use arrays.. Thanks in advanced..


  [1]: https://i.stack.imgur.com/vByYL.jpg