Arithmetics

3.2 - Addition and subtraction


The addition and subtraction operators in C++ are + and - respectively.

This line prints out the variable bananas and pineapples added together:

std::cout << bananas + pineapples << std::endl;

Task

Make the program prints out the sum of a and b in the first line and the difference of a and b in the second line.

#include <iostream> int main() { int a, b; std::cin >> a >> b; // Start your code here! }