Convert Decimal To Hexadecimal Number

in Hindi - Convert Decimal To Hexadecimal Number



not yet

Source Code :

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

int main(){

int num1, q, rem, i, j=1, r;
char num2[100];

cout<<"Enter decimal number : ";
cin>>num1;

q = num1;

while(q != 0){
r = q % 16;

if( r < 10){
r = r + 48;
}
else{
r = r + 55;
num2[j++]= r;
q = q / 16;
}
}
for(i = j -1 ;i> 0;i--){

cout<<num2[i];
}
return 0;
}