Dear members...
I'm looking for a code in C language to calculate the sum of two number in Hexadecimal base.But I don't wanna use Math library.Please help me to do it as soon as possible...
Respectfully...
Dear members...
I'm looking for a code in C language to calculate the sum of two number in Hexadecimal base.But I don't wanna use Math library.Please help me to do it as soon as possible...
Respectfully...
Use the "%x" descriptor.
int a=0x1c2a; //hex format
int b=10; //decimal format
int c;
c=a+b;
printf("HEX sum: %x\n",c);
printf("DEC sum: %d\n",c);
This will display the Hex sum: 1c34 and the Dec sum: 7220.
Dear Buffalo101
I really do appreciate...Thank you very much..The program is working fine.
But the problem is I'm trying to make a program which user able to input a two Hexadecimal number,and then the result will be the sum of those two number.
Please help me to do it.
Kind Regards...
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.