ASCII to Decimal, Hexadecimal, and Octal
This program will convert ASCII to decimal, hexadecimal, and octal.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
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;
}
Original Comments (3)
Recovered from Wayback Machine