For this WSQ we have to go to WSQ03 and make every option a function a int function being specific, so dow below is the link for this WSQ. Have a nice week. The Source Code Link flickr photo by Mario Klingemann Creative Commons Public Domain
https://github.com/estebanpinal/WSQ/blob/master/WSQ08
Quiet simple, since its the same as one of the first activities, the difference being that we used functions in this one.
Some functions inside one big function… So we had to repeat WSQ 3 with a little twist. Now all of the operations we did have to be written in functions. This was one of the easiest WSQ’s looking back on it, and still very useful and basic for the understanding of C++. Here’s the usual … Continue reading WSQ08 →
This was very easy! It was like repeating the WSQ03, just that with functions, this is something that wasn’t very difficult. Here is my code: https://github.com/Andreandc/TC1017/blob/master/WSQ08
// WSQ08 Functions #include <iostream> using namespace std; int suma (int p, int t) { int s = p+t; return s; } int resta (int p, int t) { int r = p-t; return r; } int division (int p, int t) { int d = p/t; return d; } int residuo (int p, int […]
Working with functions. Here’s the code: And the test of the code:
#include <iostream> using namespace std; int sum (int x, int y){ return x+y; } int dif (int x, int y){ return x-y; } int prod (int x, int y){ return x*y; } int divv (int x, int y){ return x/y; } int rem (int x, int y){ return x%y; } int main(){ int x,y; cout […]
#include <iostream> using namespace std; int sum (int x, int y){ return x+y; } int dif (int x, int y){ return x-y; } int prod (int x, int y){ return x*y; } int divv (int x, int y){ return x/y; } int rem (int x, int y){ return x%y; } int main(){ int x,y; cout […]