JirR02 88e0b5ed69 Converted everything to orgmode
converted everything to orgmode and added solution to the README files
2025-03-31 08:40:43 +02:00
..
2025-03-31 08:40:43 +02:00

Task 2: Representation of Integers

Task

This task is a text-based task but mostly automatically checked. You are required to write your answers into submission.txt by replacing the question marks with the correct solution. Please, do not change the line formating.

You can check whether your solution is correct by clicking on the test button.

Numbers can be provided in various formats in C++. Literals prefixed with 0b indicate binary encoding. Assume unsigned arithmetics with sufficient numbers of bits, i.e. no overflows. Convert the following binary numbers into decimal numbers (1-4) and decimal numbers to binary (5-8):

# Lines starting with # are comments. Spaces is ignored.
# Lines starting with a whitespace before # will not be a comment.

# Convert to decimal:
0b1           = ?
0b10          = ?
0b000001      = ?
0b101010      = ?

# Convert to binary:
7             = ?
11            = ?
28            = ?
1024          = ?

Solutions

# Lines starting with # are comments. Spaces are ignored.
# Lines starting with a whitespace before # will not be a comment.

# Convert to decimal:
0b1           = 1
0b10          = 2
0b000001      = 1
0b101010      = 42

# Convert to binary:
7             = 0b111
11            = 0b1011
28            = 0b11100
1024          = 0b10000000000

——-

Made by JirR02 in Switzerland 🇨🇭