Blog

July 28, 2015

Functions

 Functions_001 Tonight was about learning functions, re-usable code you can create outside the main loop that you “call on” from inside the “main” loop to make your code more organized, modular and re-useable.In this example I created a function that added numbers together or called a single number on the screen, but this time, the bulk of the program was in the functions coded above.


In main I simply used “cout” to display and add the numbers together that were setup in the function above.We also set up a Factorial function to do an equation inside itself, feeding a number into it and spitting it back out from using “cout” inside the main loop, again calling the function from above Main.

Pretty neat-o…

 

 

Programming
About admin

Leave a Reply