#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
int n;
clrscr();
cout<<"Enter any decimal number = ";
cin>>n;
cout<<"Equivalent hexadecimal number is : ";
for(int i=12;i>=0;i-=4)
{
int t=((n>>i)&15);
if(t<10)
cout<<t;
else
{
char c=t+55;
cout<<c;
}
}
getch();
}
///////////////////////////////////////////////////////////////////////////
Copy & paste this code in your TC & run, then you will get output.......
If you have any problem please comment below.........