07-26-2023, 07:48 AM
Example:
char uppercase_A = 65; // ASCII value of 'A'
char lowercase_a = 'a'; // ASCII value of 'a'
Explanation:
In C, char variables can hold numeric values that correspond to ASCII codes for characters.
In this example, we assign the integer value 65 to uppercase_A. The ASCII code 65 corresponds to the character 'A'.
We can also assign a character literal to lowercase_a. The ASCII code for lowercase 'a' is 97.
char uppercase_A = 65; // ASCII value of 'A'
char lowercase_a = 'a'; // ASCII value of 'a'
Explanation:
In C, char variables can hold numeric values that correspond to ASCII codes for characters.
In this example, we assign the integer value 65 to uppercase_A. The ASCII code 65 corresponds to the character 'A'.
We can also assign a character literal to lowercase_a. The ASCII code for lowercase 'a' is 97.