Write a java program to initialize 3 characters, and print the decimal value when the input is interpreted as a 3-digit hexadecimal number. Accept upper case letters for values from 10 to 15 i.e. 'A' represents 10, 'B' represents 11, etc. Also check for invalid input. Do not use any library/built-in function. Suppose you declare three char variables a, b and c and initialize them to be 'A', '2' and 'D' respectively, then assume the hexadecimal number to be A2D.
View All Comments
| View Tutorial