D. Simple Operations

Problem Setup

  • login to CS50 IDE
  • write cd in the terminal to go to the home directory
  • write mkdir operations to create a folder called operations
  • write cd operations to go to the operations folder
  • write code operations.cpp to create a file called operations.cpp and open it in the editor

Problem

You are given two integers \(a\) and \(b\). Print the results of:

  1. \(a + b\)
  2. \(a - b\)
  3. \(a \times b\)
  4. \(a / b\)

Input

One line containing two integers \(a\) and \(b\) where \(1 \leq a, b \leq 10^8\).

Output

Print four lines:

  1. The result of \(a + b\)
  2. The result of \(a - b\)
  3. The result of \(a \times b\)
  4. The result of \(a / b\) (integer division)

Examples

Example 1:

Input:

10 2

Output:

12
8
20
5

Example 2:

Input:

4 8

Output:

12
-4
32
0

Test Your Code

Make sure you are in the operations directory, then run the following command:

check50 iti-technical-team/problemset/2026/1/operations

Submit Your Code

Make sure you are in the operations directory, then run the following command:

submit50 iti-technical-team/problemset/2026/1/operations