D. Simple Operations
Problem Setup
- login to CS50 IDE
- write
cdin the terminal to go to the home directory - write
mkdir operationsto create a folder calledoperations - write
cd operationsto go to theoperationsfolder - write
code operations.cppto create a file calledoperations.cppand open it in the editor
Problem
You are given two integers \(a\) and \(b\). Print the results of:
- \(a + b\)
- \(a - b\)
- \(a \times b\)
- \(a / b\)
Input
One line containing two integers \(a\) and \(b\) where \(1 \leq a, b \leq 10^8\).
Output
Print four lines:
- The result of \(a + b\)
- The result of \(a - b\)
- The result of \(a \times b\)
- 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