Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.
#include <iostream>
using namespace std;
void CalcIntResults(int value1, int value2, int &addition_total, int &minus_total, int &mulplication, int &division, int &reminder);
int main(void)
{
int number1;
int number2;
int addition;
int minus;
int mulplication;
int division;
int reminder;
cout <<"Please enter two integer values seperated by whitespace: ";
cin >> number1 >>number2;
CalcIntResults(number1, number2, addition, minus, mulplication, division, reminder);
cout <<number1 <<" plus " <<number2 <<" equals " <<addition <<endl;
cout <<number1 <<" minus "<<number2 <<" equal " <<minus <<endl;
cout <<number1 <<" multiplied " <<number2 <<" equals " <<mulplication <<endl;
if(number2!=0)
{
cout <<number1 <<" divided " <<number2 <<" equals " <<division;
}
else
{
cout <<"Division by zero is undefined";
}
if((number1 % number2)!=0)
{
cout <<" reminder of " << reminder;
}
else
{
cout <<" no reminder";
}
}
void CalcIntResults(int value1, int value2, int &addition_total, int &minus_total, int &mulplication, int &division, int &reminder)
{
addition_total = value1+value2;
minus_total= value1-value2;
mulplication= value1*value2;
if(value2 !=0)
{
division = value1/value2;
}
else
{
cout <<"Division by zero is undefined";
}
}
if(number2!=0)
{
cout <<number1 <<" divided " <<number2 <<" equals " <<division;
if((number1 % number2)!=0)
{
cout <<" reminder of " << reminder;
}
else
{
cout <<" no reminder";
}
}
else
{
cout <<"Division by zero is undefined";
}
#include <iostream>
using namespace std;
void CalcIntResults(int value1, int value2, int &addition_total, int &minus_total, int &mulplication, int &division, int &reminder);
int main(void)
{
int number1;
int number2;
int addition;
int minus;
int mulplication;
int division;
int reminder;
cout <<"Please enter two integer values seperated by whitespace: ";
cin >> number1 >>number2;
CalcIntResults(number1, number2, addition, minus, mulplication, division, reminder);
cout <<number1 <<" plus " <<number2 <<" equals " <<addition <<endl;
cout <<number1 <<" minus "<<number2 <<" equal " <<minus <<endl;
cout <<number1 <<" multiplied " <<number2 <<" equals " <<mulplication <<endl;
if(number2!=0)
{
cout <<number1 <<" divided " <<number2 <<" equals " <<division;
if((number1 % number2)!=0)
{
cout <<" reminder of " << reminder;
}
else
{
cout <<" no reminder";
}
}
else
{
cout <<"Division by zero is undefined";
}
}
void CalcIntResults(int value1, int value2, int &addition_total, int &minus_total, int &mulplication, int &division, int &reminder)
{
addition_total = value1+value2;
minus_total= value1-value2;
mulplication= value1*value2;
if(value2 !=0)
{
division = value1/value2;
}
else
{
cout <<"Division by zero is undefined";
}
}
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Problem to ASCII | 1 | 176 | |
Using Diagnostic tools in VS2015: Unresoved allocations | 19 | 84 | |
What is atomic operation? | 6 | 59 | |
If a cell in a range equals "YES" return specific Test. | 4 | 30 |
Join the community of 500,000 technology professionals and ask your questions.