Yoo kawan-kawan Otaku-It disini mimin mau share program nih yaitu program convert char ke asci :v, yuk langsung aja ke source codenya dibawah ini:
#include <stdio.h>
#include <string.h>
//created by Otaku-It
int main(){
char key[25];
int key2;
int chr;
int i;
while(1){
printf("1. char to asci\n");
printf("2. asci to char\n");
printf("3. exit\n");
printf(">");
scanf("%d", &key2);
if(key2 == 1){
printf("masukkan char: ");
scanf("%s",key);
for(i = 0; i < strlen(key); i++){
printf("%c %d\n",key[i], key[i]);
}
printf("\n\n");
}
else if(key2 == 2){
printf("masukkan asci: ");
scanf("%d", &chr);
printf("result: %c\n\n\n", chr);
}
else if(key2 == 3){
printf("thanks\n");
break;
}
else continue;
}
return 0;
}
Sekian pembahasan untuk program convert char ke asci menggunakan c dari mimin sekian
Selamat mencoba '-')/ admin@z
No comments:
Post a Comment