# ASCII to Decimal, Hexadecimal, and Octal

Email
 Submitted on: 1/4/2015 10:39:00 PM By: Eric K (from psc cd) Level: Beginner User Rating: By 6 Users Compatibility: C, Microsoft Visual C++ Views: 14170

This program will convert ASCII to decimal, hexadecimal, and octal.

code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 ``` //************************************** // Name: ASCII to Decimal, Hexadecimal, and Octal // Description:This program will convert ASCII to decimal, hexadecimal, and octal. // By: Eric K (from psc cd) // // Side Effects:I am a beginner C/C++ coder so the code is probably messy and disorganized. Any feedback/suggestions is welcomed! //************************************** #include #include #include main() { char string[1024]; int length; printf("ASCII Input: "); gets(string); printf("\n"); printf("\n"); printf("Decimal Ouput:"); for(length = 0; length < strlen(string); length++) { printf("%d ", string[length]); } printf("\n"); printf("Hexadecimal Output: "); for(length = 0; length < strlen(string); length++) { printf("%x ", string[length]); } printf("\n"); printf("Octal Output:"); for(length = 0; length < strlen(string); length++) { printf("%o ", string[length]); } printf("\n"); printf("\n"); system("pause"); return 0; }```

Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)