Code: void Dec2Hex() { int n,r[10],i; printf("Enter a number to get its hexadecimal equivalent\n"); scanf("%d",&n); for(i=0;n!=0;i++) { r[i]=n%16; n=n/16; } i--; for(;i>=0;i--) { if(r[i]==10) printf("A"); else if(r[i]==11) printf("B"); else if(r[i]==12) printf("C"); else if(r[i]==13) printf("D"); else if(r[i]==14) printf("E"); else if(r[i]==15) printf("F"); else printf("%d",r[i]); } printf("\n"); } is it possible to increase the maximum input of conversion here?,, i cant convert decimal to hex that is exceeding 32k
Yes, but you can't use scanf %d. I suggest you use fgets to read whatever the user gives you, then convert whatever they give you to hex. It's not difficult.