From 486beda015e843b56885a01d3e0488036b00accd Mon Sep 17 00:00:00 2001 From: zeekling Date: Tue, 12 Oct 2021 22:19:58 +0800 Subject: [PATCH] add charcode.c --- chapter3/charcode.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 chapter3/charcode.c diff --git a/chapter3/charcode.c b/chapter3/charcode.c new file mode 100644 index 0000000..a073067 --- /dev/null +++ b/chapter3/charcode.c @@ -0,0 +1,12 @@ +#include + +int main(int argc, char const *argv[]) +{ + char ch; + + printf("Please input a Character\n"); + scanf("%c", &ch); + printf("The Code for %c is %d.\n", ch, ch); + + return 0; +}