In this article, we will see how can we print a number in hexadecimal format using C language, but before that, we will take a look at what this format is all about. In C language, a value in hexadecimal format is represented by a combination of 16 symbols, out of which 10 symbols are the standard numerical values ranging from 0 to 9 and the rest six are uppercase characters from ‘A’ to ‘F’. Here, the letter ‘A’ represent the numeric value 10, ‘B’ represents 11, ‘C’ represents 12, ‘D’ represents 13, ‘E’ represents 14 and ‘F’ represents 15. These numbers and characters when combined together to represent a value make up the hexadecimal format. How to Print Hexadecimal in C To print a number in hexadecimal format, the format specifier used is ‘%x’ or ‘%X’. Using the ‘%x’ format specifier converts all the letters contained in the hexadecimal representation of a number in lowercase and using the ‘%X’ format converts all the letters in uppercase. Let us look at some sample programs for
This website is about programming knowledge. You can call this blog best programming master.