-
Lenguaje
C
-
Descripción
Muestra la tabla ASCII con equivalencias en decimal, hexadecimal, octal y binario
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
int i, c;
for (i=0; i<128; i++)
{
if (i%23==0)
{
if (i!=0)
system ("pause");
printf ("ASCII DEC OCTAL HEX BINARIO ASCII DEC OCTAL HEX BINARIO\n");
}
for (c=i; c<256; c+=128)
{
switch (c)
{
case '\0': printf ("NULL "); break;
case '\a': printf ("BEEP "); break;
case '\b': printf ("DEL "); break;
case '\t': printf ("TAB "); break;
case '\n': printf ("CR "); break;
case '\r': printf ("LF "); break;
case 26 : printf ("SUB "); break;
default : printf ("%c ", c);
}
printf (" %3d %03o %02X %d%d%d%d%d%d%d%d%s", c, c, c,
(c/128)%2, (c/64)%2, (c/32)%2, (c/16)%2, (c/8)%2,
(c/ 4)%2, (c/2 )%2, c%2, c<128 ? " " : "\n");
}
}
system ("pause");
return EXIT_SUCCESS;
}
#include <stdlib.h>
int main (void)
{
int i, c;
for (i=0; i<128; i++)
{
if (i%23==0)
{
if (i!=0)
system ("pause");
printf ("ASCII DEC OCTAL HEX BINARIO ASCII DEC OCTAL HEX BINARIO\n");
}
for (c=i; c<256; c+=128)
{
switch (c)
{
case '\0': printf ("NULL "); break;
case '\a': printf ("BEEP "); break;
case '\b': printf ("DEL "); break;
case '\t': printf ("TAB "); break;
case '\n': printf ("CR "); break;
case '\r': printf ("LF "); break;
case 26 : printf ("SUB "); break;
default : printf ("%c ", c);
}
printf (" %3d %03o %02X %d%d%d%d%d%d%d%d%s", c, c, c,
(c/128)%2, (c/64)%2, (c/32)%2, (c/16)%2, (c/8)%2,
(c/ 4)%2, (c/2 )%2, c%2, c<128 ? " " : "\n");
}
}
system ("pause");
return EXIT_SUCCESS;
}