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; }
User Avatar

Wiki User

13y ago
This answer is:
User Avatar
Study guides

What does DOS stand for

What is a software that is distributed for free

What do unix and Linux have in common

What is full form of rams GUI

See all cards
76 Reviews
More answers
User Avatar

Wiki User

13y ago

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 );

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

%X is Splacing Hexadecimal. Number



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


This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: WRITE A Program to convert integar to hexadecimal in c language?
Write your answer...
Still have questions?
magnify glass
Continue Learning about Engineering
Related questions

The product of three greater than a negative integar and twelve less than four times the integar is equal to 64 determine the integer?


Is pi an integar number?

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

How do you find smallest integar number from a set of numbers?

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

What is the Meaning of non integer?

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

Is -3 a integer?

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