Best Answer

Use the %X modifier of printf.

Code Example:#include int main(void) { unsigned int iMyNumber = 255; printf("The number %u interpreted as hexadecimal is %X.\n", iMyNumber, iMyNumber); return 0; }Study guides

☆☆

More answers

use ultoa() function

3 arguments:

1)value to be converted

2)size of array(buffer)//to store converted value

3)base to be used

char buffer[18];

utoa( (unsigned) 12765, buffer, 16 );

%X is Splacing Hexadecimal. Number

main()

{

printf ("Decimal No=%d Hexadecimal No=%X",14,14);

}}

Q: WRITE A Program to convert integar to hexadecimal in c language?

Write your answer...

Submit

Still have questions?

Continue Learning about Engineering

Related questions

-5

no. integers are 0 1 2 3 4 5 6 etc and their negatives

Start counting from ' 1 '. The first number you name that is a member of the set is the smallest integer in the set.

an integer is a whole number so any fraction or decimal is a non-integer. for example 4 is an integar but 4.865 or 8/32 re not integars

Yes, integers are all whole, negative and positive numbers, including 0.