Explanation of the Solution | Converting to a binary number
1. Katas
1.Create variables for work:
- num, enter our number and check that it is an integer.
- number, remember our number entered for the final output.
- binary_num, the string for the binary number.
2.Check whether the number is negative or not.
3.Go to the main part of the program:
- run the while loop, so we can convert our number to binary.
- if the negative number is added negative.
4.Display the line as requested.
That's all.
If you liked Katas, you can put star on this repositories, this will motivate me to write similar Katas for you.
Visit Github page: