![]() |
VOOZH | about |
Given a Unicode number, the task is to convert this into an ASCII (American Standard Code for Information Interchange) number.
ASCII is a character encoding standard used in communication systems and computers. It uses 7-bit encoding to encode 128 different characters 0-127. These values generally include numbers, letters, punctuation, and some control characters. It primarily focuses on representing English symbols.
Unicode is a character encoding well known used in conversation structures and computer systems. Unlike ASCII, which uses 7-bit encoding and encodes 128 unique characters (zero-127), Unicode makes use of variable-period encoding to symbolize a full-size variety of characters from numerous scripts and languages. Unicode can represent over 1,000,000 distinct characters, making it a comprehensive character encoding standard.
Examples:
Input: Unicode = 'A'
Output: ASCII = 65Input: Unicode = 'Z'
Output: ASCII = 90
Approach: Follow the below steps to convert unicode to ASCII number
Following is the code to get the ASCII value of a given character.
Unicode: A ASCII: 65
Time Complexity: O(1)
Auxiliary Space: O(1)