Meinst du so ?
Code:
#include <conio.h> #include <stdio.h> void main() { char i; printf("hexadezimale Zahl (ohne 0x) eingeben: "); scanf("%x", &i); if(i>=10 && i<=15) { printf("hexadezimal 0x%x in dezimaler Darstellung: %d\n",i,i); } else if (i>=0 && i<=9) { printf("hexadezimal 0x%x in dezimaler Darstellung: %d\n",i,i); } else { printf("Dies ist keine Hexzahl\n"); } }
Comment