From dc47d48cd81c55424fcc3d3b03d29d35ba49d4dc Mon Sep 17 00:00:00 2001 From: ashwek Date: Tue, 12 Feb 2019 18:40:26 +0530 Subject: [PATCH] Removed Others/Decimal To Hexadecimal .cpp updated versions exists (Decimal To Hexadecimal.cpp) --- Others/Decimal To Hexadecimal .cpp | 51 ------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 Others/Decimal To Hexadecimal .cpp diff --git a/Others/Decimal To Hexadecimal .cpp b/Others/Decimal To Hexadecimal .cpp deleted file mode 100644 index fadddfd74..000000000 --- a/Others/Decimal To Hexadecimal .cpp +++ /dev/null @@ -1,51 +0,0 @@ -#include - -using namespace std; - -void main(void) -{ - int valueToConvert = 0; //Holds user input - int hexArray[8]; //Contains hex values backwards - int i = 0; //counter - int lValue = 0; //Last Value of Hex result - - cout << "Enter a Decimal Value" << endl; //Displays request to stdout - cin >> valueToConvert; //Stores value into valueToConvert via user input - - while (valueToConvert > 0) //Dec to Hex Algorithm - { - lValue = valueToConvert % 16; //Gets remainder - valueToConvert = valueToConvert / 16; - hexArray[i] = lValue; //Stores converted values into an array - i++; - } - cout << "Hex Value: "; - while (i > 0) - { - //Displays Hex Letters to stdout - switch (hexArray[i - 1]) { - case 10: - cout << "A"; - break; - case 11: - cout << "B"; - break; - case 12: - cout << "C"; - break; - case 13: - cout << "D"; - break; - case 14: - cout << "E"; - break; - case 15: - cout << "F"; - break; - default: - cout << hexArray[i - 1]; //if not an int 10 - 15, displays int value - } - i--; - } - cout << endl; -}