Write a program that takes two numbers as arguments and prints the consecutive values that begins at the first number and end at the second number (including the values of those numbers !).
- **Allocate (with `make`)** a slice of integers.
- Fill it with consecutive values that begins at the first argument and end at the second argument (Including the values of thoses arguments !).
- That prints the slice.
Errors should be handled.
Errors should be handled.
@ -19,12 +13,12 @@ If the number of arguments is different from 2 the program prints nothing.
```console
```console
student@ubuntu:~/range$ go build
student@ubuntu:~/range$ go build
student@ubuntu:~/range$ ./range 1 3
student@ubuntu:~/range$ ./range 1 3
[1 2 3]
1 2 3
student@ubuntu:~/range$ ./range -1 2 | cat -e
student@ubuntu:~/range$ ./range -1 2 | cat -e
[-1 0 1 2]$
-1 0 1 2$
student@ubuntu:~/range$ ./range 0 0
student@ubuntu:~/range$ ./range 0 0
[0]
0
student@ubuntu:~/reverserange$ ./reverserange 0 nan | cat -e
Write a program that takes two numbers as arguments and prints the consecutive values that begins at the second number and end at the first number (including the values of those numbers !).
- **Allocate (with `make`)** a slice of integers.
- Fill it with consecutive values that begins at the second argument and end at the first argument (Including the values of thoses arguments !).
- That prints the slice.
Errors should be handled.
Errors should be handled.
@ -19,13 +13,13 @@ If the number of arguments is different from 2 the program prints nothing.