Convert Decimal number to Hexadecimal number

Decimal number to Hexadecimal number

Convert decimal number to hexadecimal number

We started with the short description of Hexadecimal and Decimal number-
Hexadecimal number system: It is base 16 number system which uses the digits from 0 to 9 and A, B, C, D, E, F. Used by computers to easily represent binary numbers.

Decimal number system: It is base 10 number system which uses the digits from 0 to 9. Used by humans.

#include <stdio.h>
void main() 
    long int decn,rmd,q,dn=0,m,l;
    int i=1,j,tmp;
        char s;
printf("\n\t\t\t...Welcome To EduNews.Tech... ");

       printf("\n\nConvert Decimal to Hexadecimal:\n ");

    printf("Input  any Decimal number: ");
    q = decn;
        tmp = l % 16;
        if( tmp < 10)
                   tmp =tmp + 48; else
                 tmp = tmp + 55;
          printf("\nThe equivalent Hexadecimal Number : ");
               s=m % 100;
printf("\n\n\n\t\t\tThankyou for Joining Us !");
    printf("\n\t\t\t!Regards EduNews !");


Program Output:

decimal to hexadecimal

I hope this post helps you to understand the program “Convert Decimal number to Hexadecimal number” and its implementation in C programming language.

Keep coding 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *