B. Equation
Problem Setup
- login to CS50 IDE
- write
cdin the terminal to go to the home directory - write
mkdir equationto create a folder calledequation - write
cd equationto go to theequationfolder - write
code equation.cppto create a file calledequation.cppand open it in the editor
Problem
You are given \(4\) integers \(a\), \(b\), \(c\), and \(d\). You need to calculate the value of \(z = a \times b + c - d\), where \(z\) is the result of the calculation.
Input
One line containing four integers \(a\), \(b\), \(c\), and \(d\) where \(1 \leq a, b, c, d \leq 1000\).
Output
Print the value of \(z\) in a single line, where \(z = a \times b + c - d\).
Example
Input:
4 2 5 3
Output:
10
Test Your Code
Make sure you are in the equation directory, then run the following command:
check50 iti-technical-team/problemset/2026/1/equation
Submit Your Code
Make sure you are in the equation directory, then run the following command:
submit50 iti-technical-team/problemset/2026/1/equation