WSQ03 – Fun with numbers

2 min read

#WSQ03 #TC1710 This is a really interesting activity because we learnt how to use integer values and we use that to calculate:

  • The sum of the two numbers.
  • 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.

First of all, is really important to know how to declare an integer value and how to make the calculations. I found information really useful in the following links:
http://www.cplusplus.com/doc/tutorial/variables/
http://www.programacionfacil.com/cpp/operadores_aritmeticos
Also, there is a command that saves the value that the user gives to the variables, it is called cin, when you want to write it in your code you have to write cin>>x, where x is the name of the variable that receives the value. Here is a link with information about that:
http://programa-c.blogspot.mx/2010/04/codigos-c-suma-dos-numeros-enteros.html
Finally, in the following link you will find my c++ code:
https://drive.google.com/file/d/0B-NM4ghaDXBvREdHM1VwbjJqVEU/view?usp=sharing
Also, I will share with you some images, one shows my code and the other one shows the program working.

CC BY 4.0 WSQ03 – Fun with numbers by Tania Pardo is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.