On to functions ÷+-

This program was about to create our own functions. I reuse a previous program that I have done before, that program is “Fun with numbers”, I posted it too. So what I have to do was to create my own functions to calculate the sum, the difference, the product, the integer based division and the remainder of integer division of the two numbers instead of writing the calculation in the program. To create a function just declare what kind of values it will store (int, string, float) followed by its name int sum then in parentheses write the list of parameters that specifies what information you have to provide in order to use the new function int sum (int x, int y), after that just add a pair of square brackets and inside them write what you want your function to do. When you have created all the functions you need, is time to call them in your program. To call them you just have to create a new variable and inside it add the function, if everything is good it must run without any problem. #WSQ05 #newfunctions #creatingfunctionsCaptura de pantalla 2017-09-14 a las 22.20.16Captura de pantalla 2017-09-14 a las 22.20.26Captura de pantalla 2017-09-14 a las 22.21.56Captura de pantalla 2017-09-14 a las 22.21.10

Deja un comentario