#include <stdio.h>
int main() {
char ascii_char = 'A';
char hex_value[3];
// Convert ASCII character to hex value
sprintf(hex_value, "%02X", ascii_char);
printf("The hexadecimal value of '%c' is: 0x%s\n", ascii_char, hex_value);
return 0;
}
/*
run:
The hexadecimal value of 'A' is: 0x41
*/