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/i16dec2hexs.c        | 38 ++++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 src/c/elementaryFunctions/radix_conversions/dec2hex/i16dec2hexs.c

(limited to 'src/c/elementaryFunctions/radix_conversions/dec2hex/i16dec2hexs.c')

diff --git a/src/c/elementaryFunctions/radix_conversions/dec2hex/i16dec2hexs.c b/src/c/elementaryFunctions/radix_conversions/dec2hex/i16dec2hexs.c
new file mode 100644
index 00000000..f556141d
--- /dev/null
+++ b/src/c/elementaryFunctions/radix_conversions/dec2hex/i16dec2hexs.c
@@ -0,0 +1,38 @@
+#include <string.h>
+#include <math.h>
+#include "dec2hex.h"
+#include <stdio.h>
+
+void i16dec2hexs(int16 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<j)
+	{
+		tmp=out[i];
+		out[i]=out[j];
+		out[j]=tmp;
+		i++;
+		j--;
+	}
+	out[i+1]='  ';
+    
+}
-- 
cgit