forked from root/public
Hamza elkhatri
2 years ago
committed by
David Mata
1 changed files with 13 additions and 17 deletions
@ -1,27 +1,23 @@ |
|||||||
## print-ascii |
## print-ascii |
||||||
|
|
||||||
### instructions |
### Instructions |
||||||
|
|
||||||
Write a program that prints the ASCII value of a character passed as an argument to the program |
Write a program that prints the ASCII value of a letter passed |
||||||
- If the argument is not a letter nothing will be printed |
- If the argument is not a letter nothing will be printed |
||||||
- if the number of arguments is not 1 then nothing will be printed |
- if the number of arguments is not 1 then nothing will be printed |
||||||
- the program should print (`'\n'`) at the end of the output |
|
||||||
|
|
||||||
### Usage |
### Usage |
||||||
|
|
||||||
```console |
```console |
||||||
$ go run . | cat -e |
$ go run . |
||||||
$ |
$ go run . a |
||||||
$ go run . a | cat -e |
97 |
||||||
97$ |
$ go run . 'A' |
||||||
$ go run . 'A' | cat -e |
65 |
||||||
65$ |
$ go run . 'z' |
||||||
$ go run . 'z' | cat -e |
122 |
||||||
122$ |
$ go run . Z |
||||||
$ go run . Z | cat -e |
90 |
||||||
90$ |
$ go run . 1 |
||||||
$ go run . 1 | cat -e |
$ go run . "Hello" "Word" |
||||||
$ |
|
||||||
$ go run . "Hello" "Word" | cat -e |
|
||||||
$ |
|
||||||
``` |
``` |
||||||
|
Loading…
Reference in new issue