Skip to content

Commit 79813ba

Browse files
committed
Create Number-To-Ascii
Basic C Script that converts a number (integer) to a ASCII correspondent character (char)
1 parent 220d6c0 commit 79813ba

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

C/Number-To-Ascii.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#include <stdio.h>
2+
3+
int main()
4+
{
5+
int num;
6+
printf("Please insert a number between 0 and 255 [0-255]: ");
7+
scanf("%d",&num);
8+
9+
if(num >= 0 && num <= 255)
10+
{
11+
12+
printf("\n The number %d in ASCII is %c \n",num,num);
13+
14+
}
15+
else{
16+
17+
printf("The selected number is not between 0 and 255, please try again. \n");
18+
19+
}
20+
21+
22+
return 0;
23+
}

C/Number-To-Ascii.exe

407 KB
Binary file not shown.

0 commit comments

Comments
 (0)