I am new to programming and I have to write the code which will print the ASCII value of an input character. Is there any other way to reduce the 52 (26 for lowercase and 26 for upper)
Because it's not clear what you are trying to do, your question is not very well written. However, I think you need to take a look at typecasting.
Try this statement to convert the character to the corresponding ASCII value:
int output = (int)inputCharacter;