From 1fd0dce8d72c4d5869ce5ff4025ac09af603bc0f Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 19 Apr 2017 14:57:49 +0530 Subject: Merged Shamik's work --- .../radix_conversions/dec2hex/ddec2hexs.c | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/c/elementaryFunctions/radix_conversions/dec2hex/ddec2hexs.c (limited to 'src/c/elementaryFunctions/radix_conversions/dec2hex/ddec2hexs.c') diff --git a/src/c/elementaryFunctions/radix_conversions/dec2hex/ddec2hexs.c b/src/c/elementaryFunctions/radix_conversions/dec2hex/ddec2hexs.c new file mode 100644 index 0000000..0adafef --- /dev/null +++ b/src/c/elementaryFunctions/radix_conversions/dec2hex/ddec2hexs.c @@ -0,0 +1,39 @@ +#include +#include +#include "dec2hex.h" +#include + +void ddec2hexs(double in,char* out) +{ + int quot; + int i=0,j=0,k=0,tmp,temp; + quot=(int)in; + while(quot!=0) + { + temp=quot%16; + //To convert integer into character + if(temp < 10) + temp = temp + 48; + else + temp = temp + 55; + + out[i++]=temp; + quot = quot/16; + //printf("%c ",out[i-1]); + } + out[i]='\0'; + j=i-1; + i=0; + + while(i