All pastes #180309 Raw Edit

Conversion

public c v1 · immutable
#180309 ·published 2006-09-23 00:55 UTC
rendered paste body
short info() /* version, author, and function */{printf("This is Conversion 0.5.9, written by LazyFIDERook.\n");printf("This program takes a decimal number and converts it to other formats.\n \n");}main() /* the actual program */{char command[64];printf("Type a decimal number, or \"quit\" to exit: ");scanf("%s", command);if(!strcmp(command, "quit")||!strcmp(command, "qui")||!strcmp(command, "qu")||!strcmp(command, "q")){printf("Are you sure? [Y/N] ");scanf("%s", command);if(!strcmp(command, "y")||!strcmp(command, "Y")){printf("Exit Successful.\n");exit(0);}if(!strcmp(command, "n")||!strcmp(command, "N")){printf("Exit Cancelled.");printf("\n");}}else{printf("This is the octal format:                 %o\n");printf("This is the hexadecimal format:           0x%x\n");printf("This is the ASCII character:              %c\n");}while(1){printf("\nType another number, or \"quit\" to exit: ");scanf("%s", command);if(!strcmp(command, "quit")||!strcmp(command, "qui")||!strcmp(command, "qu")||!strcmp(command, "q")){printf("Are you sure? [Y/N] ");scanf("%s", command);if(!strcmp(command, "y")||!strcmp(command, "Y")){printf("Exit Successful.\n");exit(0);}if(!strcmp(command, "n")||!strcmp(command, "N")){printf("Exit Cancelled.");printf("\n");}}else{printf("This is the octal format:               %o\n");printf("This is the hexadecimal format:         0x%x\n");printf("This is the ASCII character:            %c\n");}}return(0);}