KEMBAR78
Assignment 1. Integer Arithmetic | PDF
0% found this document useful (0 votes)
17 views2 pages

Assignment 1. Integer Arithmetic

The document describes a programming assignment to take in two 8-bit integers, get their binary representations, and output the results of adding, subtracting, multiplying, dividing, and getting the remainder of the two numbers in both binary and decimal formats.

Uploaded by

phamkhanhhan6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Assignment 1. Integer Arithmetic

The document describes a programming assignment to take in two 8-bit integers, get their binary representations, and output the results of adding, subtracting, multiplying, dividing, and getting the remainder of the two numbers in both binary and decimal formats.

Uploaded by

phamkhanhhan6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

INTEGER ARITHMETIC

1. Language: C/C++

2. Requirement: Input two 8 bits signed integers called A and B. Solve the following
problems:
a. Get bits of A and B. Store to two bit arrays char arrA[8] and arrB[8] then print
out those two.
b. Write functions: add, subtract, multiply, divide of arrA and arrB

Output sample:

Input A (Decimal): 10

Input B (Decimal): 5

A (Binary): 00001010

B (Binary): 00000101

A + B (Binary): 00001111

A + B (Decimal): 15

A - B (Binary): 00000101

A - B (Decimal): 5

A * B (Binary): 00110010

A * B (Decimal): 50

A / B (Binary): 00000010

A / B (Decimal): 2

A % B (Binary): 00000000

A % B (Decimal): 0

3. Submission instructions
- Please submit your assignment to the Moodle
- The assignment will be compressed to a zip/rar file named MSSV.zip/rar that
includes two files:
o MSSV.c/cpp: Source code
o MSSV.docx/pdf:
▪ Screenshots of the program output (Unit Test)
▪ What percentage of the work is done?

You might also like