A program that read any decimal number & display equivalent hexadecimal number in Cpp.

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

void main()
{
    int n,a[10],i=0;
    clrscr();
    cout<<"Enter any decimal number : ";
    cin>>n;
    while(n/16!=0)
    {
        a[i++]=n%16;
        n=n/16;
    }
    a[i]=n;

    cout<<"Equivalent hexadecimal number is :";
    for(;i>=0;i--)
      cout<<a[i];
    getch();
}


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