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

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Salir /  Cambiar )

Google photo

Estás comentando usando tu cuenta de Google. Salir /  Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Salir /  Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Salir /  Cambiar )

Conectando a %s