/* HEx.c Convertitore di caratteri da decimale a esadecimale e viceversa. Copyright (C) 2001 Nicola Piazzolla This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* HEx.c created by kc */ #include int x; char scelta[389]; char y; main () { printf("\t\tCONVERTITORE ESADECIMALE/DECIMALE\n"); printf("************************************************************\n"); printf("*Digitare Hex per la conversione da decimale in esadecimale*\n"); printf("*Digitare Dec per la conversione da esadecimale a decimale*\n"); printf("*Digitare contact per avere informazioni su di me *\n"); printf("*Premere Ctrl + Z o Ctrl + C per uscire. *\n"); printf("************************************************************\n"); while(1) { printf("Fare una SCELTA: "); scanf("%s",scelta); if((strcmp(scelta,"contact")==0) || (strcmp(scelta,"Contact")==0)) { printf("Ciao! sono kc ; email : < ircopit@yahoo.it > \n"); printf("IRC: server channel < #penguin.it > \n"); } if ((strcmp(scelta,"Hex")==0) || (strcmp(scelta,"hex")==0)) { printf("\nInserire la lettera , per convertirla in numero esadecimale"); while (1) { scanf("%c",&y); puts(""); scanf("%c",&y); printf("\nLa conversione in Esadecimale e' \\x%x",y); } } if ((strcmp(scelta,"Dec")==0)||(strcmp(scelta,"dec")==0)) { printf("\nInserire il numero in esadecimale per convertirlo in lettera"); printf(" o cifra"); while(1){ scanf ("%x",&x); printf("\nLa conversione in Lettera o numero e' %c",x); } } } }