Raj Kumar Raj Kumar - 1 year ago 105
C++ Question

C++ : How to reduce conditional statements

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)

statements or 52

Answer Source

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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download