WSQ 01 Fun with Numbers

This was the first assignment, I did it long ago but I deleted it by accident. I re-upload it to have every assignment on my blog. Now my blog has no chronological order and my OCD is worse than ever.

Anyway, the program asks the user for two numbers and then it adds, substract, multiply, divide and gives the reminder of their division.

 

#include <iostream>

int main() {

int num1;
int num2;

std::cout << “Enter first number:” << ‘\n’;
std::cin >> num1;
std::cout << “Enter second number:” << ‘\n’;
std ::cin >> num2;
std::cout << “Sum, difference, product, quotient, reminder, respectively.” << ‘\n’;

std::cout << num1 + num2 << ‘\n’;
std::cout << num1 – num2 << ‘\n’;
std::cout << num1 * num2 << ‘\n’;
std::cout << num1 / num2 << ‘\n’;
std::cout << num1 % num2 << ‘\n’;

return 0;
}

 

fun-with-numbers-codefun-with-numbers-terminal