#include <stdio.h>
int main () {
char z1, z2;
printf("please write z1 and z2 :\n");
scanf (" %c \n, %c \n", &z1,&z2);
if (z1 < z2) {
printf (" In the ASCII-Tabel comes %c befor %c. \n" ,z1, z2);
}
return (0) ;
}
So i am trying to write a code where i have to give two letter from the alphabet and it has to tell me which of the two letters comes first int eh alphabetical order. I have written this code and i can compile it. If a define z1 and z1 character for example z1 = 'A' and z2 = 'c' it works fine . but how can i do it without having to define z1 and z2 with a letter ,instead give any letter i like on the compiler in order to achieve the same result.
Aucun commentaire:
Enregistrer un commentaire