answersLogoWhite

0


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

14y ago
This answer is:
User Avatar
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

main()

{

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...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering
Related questions

Can you covert 157.48 cm to integer?

i want to convert 157.48 into integar


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

-5


How to convert 157.48cm into integar?

157.48 cm = 157 cm (rounding down) or 158 cm (rounding up) 157.48 cm = 62 inches (rounding up) or 61 inches (rounding down)


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.