forked from root/public
Compare commits
5 Commits
1278-delet
...
master
Author | SHA1 | Date |
---|---|---|
MSilva95 | eb95584405 | 2 years ago |
Hamza elkhatri | 3bdf80b9c6 | 2 years ago |
Hamza elkhatri | 216b1a9efa | 2 years ago |
hamza | e0693e278a | 2 years ago |
davhojt | 25400daa15 | 2 years ago |
2 changed files with 29 additions and 5 deletions
@ -0,0 +1,25 @@
|
||||
## get-area |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that takes a positive number as radius and prints the area of a circle. |
||||
- The area of the circle is `3.14` times the radius squared. |
||||
- Only positive numbers will be accepted, otherwise print `Error` followed by (`'\n'`) |
||||
- If the number of arguments is not `1` print (`'\n'`) |
||||
- The output must be an integer. |
||||
|
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
$ go run . | cat -e |
||||
$ |
||||
$ go run . 10 | cat -e |
||||
314$ |
||||
$ go run . 4 | cat -e |
||||
50$ |
||||
$ go run . -10 | cat -e |
||||
Error$ |
||||
$ go run . "Hello World!" | cat -e |
||||
Error$ |
||||
``` |
Loading…
Reference in new issue