Character A and z to ASCII and Unicode Hexadecimal FA6B
to binary
Answers
Answered by
1
void ans()
{
int b=(int)'A';
System.out.println(b);
int c=(int)'z';
System.out.println(b);
}
{
int b=(int)'A';
System.out.println(b);
int c=(int)'z';
System.out.println(b);
}
Answered by
0
int ch;
for (ch = 'A'; ch <= 'z' ; ch++)
printf("char: %c, ascii %d \n", ch, ch);
=============
char input[100]; int i;
scanf("%s", input);
for (i = 0; i < strlen(input) ; i++) {
switch (toupper(input [i])) {
case '0': printf("0000 "); break;
case '1': printf("0001 ");break;
case '2': printf("0010 ");break;
case '3': printf("0011 ");break;
case '4': printf("0100 ");break;
case '5': printf("0101 ");break;
case '6': printf("0110 ");break;
case '7': printf("0111 "); break;
case '8': printf("1000 ");break;
case '9': printf("1001 "); break;
case 'A': printf("1010 "); break;
case 'B' : printf("1011 " ); break;
case 'C': printf("1100 "); break;
case 'D': printf("1101 "); break;
case 'E': printf("1110 "); break;
case 'F' : printf("1111 "); break;
default: printf"error\n");
}
}
printf("\n");
for (ch = 'A'; ch <= 'z' ; ch++)
printf("char: %c, ascii %d \n", ch, ch);
=============
char input[100]; int i;
scanf("%s", input);
for (i = 0; i < strlen(input) ; i++) {
switch (toupper(input [i])) {
case '0': printf("0000 "); break;
case '1': printf("0001 ");break;
case '2': printf("0010 ");break;
case '3': printf("0011 ");break;
case '4': printf("0100 ");break;
case '5': printf("0101 ");break;
case '6': printf("0110 ");break;
case '7': printf("0111 "); break;
case '8': printf("1000 ");break;
case '9': printf("1001 "); break;
case 'A': printf("1010 "); break;
case 'B' : printf("1011 " ); break;
case 'C': printf("1100 "); break;
case 'D': printf("1101 "); break;
case 'E': printf("1110 "); break;
case 'F' : printf("1111 "); break;
default: printf"error\n");
}
}
printf("\n");
Similar questions