1 2 3 4 5 6 1 A B C D E F 2 G H I J K L 3 M N O P R S 4 T U V Y Z W 5 X 1 2 3 4 5 6 6 7 8 9 ? ! 7 - + * I want to do that.
HELLO 1234 equivalent -> 221526263352535455
It is output that I got.
636465
I started with a simple logic, but could not continue.
My codes.
#include <stdio.h> #include <string.h> int main(){ int i,j; char string[20]; char b[7][6]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','R','S','T','U' ,'V','Y','Z','W','X','1','2','3','4','5','6','7','8','9','?','!','-','+','*'}; printf("please enter an input"); scanf("%s",&string); for(i=0;i<7;i++){ for(j=0;j<6;j++){ if(string[i]==b[i][j]) printf("%d%d",i,j); } } return 0; }
&inscanf.b[][]to be indexed by letters, likeb['H'] = 22...scanf().