C Program To Print ASCII Value of a Character
Given a character, we need to print its ASCII value in C.
Input: a Output: 97 Input: D Output: 68
C code: We use format specifier here to give numeric value of character. Here %d is used to convert character to its ASCII value.
The ASCII value of k is 107
Time complexity: O(1) since performing constant operations
Auxiliary Space: O(1)
Please refer complete article on Program to print ASCII Value of a character for more details!