A Program That Read Any Decimal Number & Display Equivalent Hexadecimal number.

#include<stdio.h>
#include<conio.h>

void main()
{
    int i,n,t;
    clrscr();
    printf("Enter any decimal number = ");
    scanf("%d",&n);
   
    printf("Equivalent hexadecimal number is : ");
    for(i=12;i>=0;i-=4)
    {
       t=((n>>i)&15);
       if(t<10)
       printf("%d",t);
       else
       printf("%c",t+55);
    }

    getch();
}

///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........