--Originally published at The Talking Chalk
This surely was easy. I have already the power of the functions in my veins, flowing and flowing like a rainbow through the cloudy skies.
Here comes dat Chalk.
int waddup(waddup)
{
return waddup
}
Here comes dat Chalk.
Watch him coding.
Watch his bash.
Watch him coding.
Watch his bash.
Jokes aside, I only had to créate a function for each task and return in each the designated mathematical operation of the two parameters.
#include <iostream>
#include <string>
using namespace std;
int sum(int x ,int y)
{
return x+y;
}
int abst(int x ,int y)
{
return x-y;
}int mult(int x ,int y)
{
return x*y;
}
int divid(int x ,int y)
{
return x/y;
}
int remain(int x ,int y)
{
return x%y;
}
int main()
{
int number_one = 0;
int number_two = 0;
cout << “Enter an integer value:” << endl;
cin>> number_one;
cout <<“You chose: ” << number_one << “.” << endl;
cout << “Enter another integer value: \n”;
cin>> number_two;
cout << “You chose: ” << number_two << “.” << endl;
cout << “The sum of these values is equal to: ” << sum(number_one, number_two) << “.” << endl;
cout << “The difference of these values is equal to: ” << abst(number_one, number_two) << “.” << endl;
cout << “The product of these values is equal to: ” << mult(number_one, number_two) << “.” << endl;
cout << “The division of these values with no decimals is equal to: ” << divid(number_one, number_two) << “.” << endl;
cout << “The remainder of these values is equal to: ” << remain(number_one, number_two) << “.” << endl;
return 0;
}