Well, to begin the task is called fun with numbers for a reason , itself is very simple , it is a simple code that I was not in the least complicate

Here I leave a picture of the code in Atom and Cygwin

#WSQ03

Skip to content
# Tag: #WSQ03

# Fun With Numbers #WSQ03

# WSQ03 – Fun With Numbers

# Wsq03/WSQ08

# #WSQ03 -Fun with numbers

# Fun with numbers WSQ03

# WSQ03-Fahn with numbers

# #WSQ03 – Fun With Numbers

# Playing with numbers

# WSQ3

# WSQ03 – Fun With Numbers

Fundamentals and Solutions. Together!

Ask the user for two integer values, then use those two values to calculate and show the following:

- The difference of the two numbers.
- The product of the two numbers.
- The integer based division of the two numbers (so no decimal point). First divided by second.
- The remainder of integer division of the two numbers.

Esta actividad se trata de realizar operaciones sencillas en el programa:

- Resta
- Multiplicación
- División
- Residuo de la división

Al momento de compilar este programa en Cygwin, se le preguntará al usuario por 2 números, al momento de seleccionar los 2 números, automáticamente se realizarán las operaciones ya mencionadas.

Debajo de int main(){, podemos observar varios *int*, es la abreviatura de integer, el cual significa que se nombran únicamente números enteros.

El usuario teclea algo gracias a cin>> y se guarda el en integer, en este caso, los integers d y a.

En donde dice *Resta= d-a* se declara que significa resta

En <<Resta se realiza la operación de la resta y te da el resultado

Estas notas se repiten para cada operación.

These activities were about creating a program in which they calculate the division, sum, difference and the division remainder of two given numbers. It didn’t ask you to do it with function but I did anyways and that was asked in WSQ08. Everything is better if you use functions, for this you have to define your variables. To do this activity I had to check how to define a function, and now I know that you can define it with int, float, long, char.

In this assignment we had to create a programm that gave you the result of a sum, difference, product, and division from 2 numbers that you typed.

So first I wrote the usual stuff of

#include <iostream>

using namespace std;

Then I asked my friend Miguel how to put the values that you type into the “x” & “y”. He told me that we need to use cin >> so the programm knows that you will give the value of that integer.

After that, I was all like pure algebra.

At the end, do not forget to write return 0, because we are using an int main function, so it need to be return 0, at the end.

Here’s also the link to my GitHub.

https://github.com/antonioangelm24/TC101/blob/master/WSQ03.cpp

Hello everyone!! This WSQ was simple, all about variables, the task is to ask the user for two integer numbers and calculate the following instructions:

- The difference of the two numbers.
- The product of the two numbers.
- The integer based division of the two numbers (so no decimal point). First divided by second.
- The remainder of integer division of the two numbers.

If you search in youtube or google, you can find various examples about this, most of them are in english, but are very helpful, I will leave some ones here.

This one is in English http://www.lynda.com/C-tutorials/Defining-variables/182674/366529-4.html.

As always, the link for my code in GitHub

In today’s post we’re having *fahn* with numbers. We’re back on our elementary school days, learning how to sum, subtract, multiply, divide, get the division’s remainder, etc., we know our stuff when coming to this, right? But what about python?… Well, doing arithmetical operations in python is much more easy, just learn how to ask for it and python will do it for you :

———————————————————————-

———————————————————————-

There, we’re making a sum, right? but wait!

———————————————————————-

———————————————————————-

Our program doesn’t do anything at all… Well, duh, we’re not printing anything, so this should do it :

———————————————————————-

Editor :

Terminal :

———————————————————————-

Yeah, there. 2 + 1 = 3, that’s right… right?… google cal… 2 + 1… yep, that’s 3. Great, so that’s how it’s done. now lets try all the other operations:

———————————————————————-

This is my code written in atom and running in the command prompt. The only thing you need to know in order to do this are two basic things. Asking the user for an input in this case specifically for an integer; And the basic math operators that are + – / * and the residual function mod that gives you the remainder of the division, if there is any.

#TC101

This WSQ was about asking the user for two integer numbers and then showing the difference, the product, the division and the remainder of integer division of those two numbers.

I didn´t have a lot of problems with this one. The structure was similar to other one I had made before but with more instructions on what the programs has to make. What I didn´t know was who to print the results of the instructions. So I look for it and found a blog that had a similar program, there I noticed that for printing you use also ” << ” after adding that my program worked correctly. If you want to see the blog click here.

You can see my program here: Playing with numbers.