public/subjects/paramcount
xpetit 46f4ddc49e
Simplify prompt, execution of Go programs, fix typos
2021-04-28 11:47:34 +02:00
..
README.md Simplify prompt, execution of Go programs, fix typos 2021-04-28 11:47:34 +02:00

README.md

paramcount

Instructions

Write a program that displays the number of arguments passed to it. This number will be followed by a newline ('\n').

If there is no argument, the program displays 0 followed by a newline.

Usage

$ go run . 1 2 3 5 7 24
6
$ go run . 6 12 24 | cat -e
3$
$ go run . | cat -e
0$
$