From 52bfbb7d5d443cd2888a97e451450d5129025062 Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 14:26:31 +0100 Subject: [PATCH] printbits readme for the exams --- subjects/printbits.en.md | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/subjects/printbits.en.md b/subjects/printbits.en.md index 65be83a1b..dc9400e35 100644 --- a/subjects/printbits.en.md +++ b/subjects/printbits.en.md @@ -2,18 +2,21 @@ ### Instructions -Write a function that takes a byte, and prints it in binary value **without a newline at the end**. - -### Expected function - -```go -func PrintBits(octe byte) { - -} -``` - -### Usage - -Example of output: - -If 2 is passed to the function `PrintBits`, it will print "00000010". +Write a program that takes a number as argument, and prints it in binary value **without a newline at the end**. + +- If the the argument isn't a number it should print `00000000`. + +### Expected output : + +```console +student@ubuntu:~/printbits$ go build +student@ubuntu:~/printbits$ ./printbits 1 +00000001student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 192 +11000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits a +00000000student@ubuntu:~/printbits$ +student@ubuntu:~/printbits$ ./printbits 1 1 +student@ubuntu:~/printbits$ ./printbits +student@ubuntu:~/printbits$ +``` \ No newline at end of file