PROBLEM 1: Write a program using VOID FUNCTION that will display the sum, product, difference, quotient and modulus of two numbers. Note: Create function name for sum, product, difference quotient and modulus. Complete the program codes below to finish the problem requirements. SAMPLE OUTPUT: Enter first number: 7 Enter second number: 2 The sum is 9 The product is 14 The difference is 5 The quotient is 3 The modulus is 1 SOURCE CODE: Update the source code below #include<iostream> using namespace std; void addTwoNumbers(int , int); // function name for sum // Create function name for product // Create function name for difference // Create function name for quotient // Create function name for modulus int num1, num2, sum=0; // global variable main() { cout<<" *****************************************"; cout<<"\n * Name: *"; cout<<"\n * Section: *"; cout<<"\n *****************************************"; cout<<”Enter first number: “; cin>> num1; cout<<”Enter second number: “; cin>> num2; addTwoNumbers(num1, num2); <insert your codes here> }//end of main //Calling Function addTwoNumbers void addTwoNumbers (int a, int b) { sum= a + b; cout<<"The sum is "<< sum; }
INSTRUCTION: Read and study the assignment below. Solve the problem using C++ programming
language, compile, run and screen shot the correct output. Copy and paste the source code or program
code and the required sample output (screen shot) in the format below.
PROBLEM 1: Write a program using VOID FUNCTION that will display the sum, product, difference, quotient and
modulus of two numbers.
Note: Create function name for sum, product, difference quotient and modulus.
Complete the program codes below to finish the problem requirements.
SAMPLE OUTPUT:
Enter first number: 7
Enter second number: 2
The sum is 9
The product is 14
The difference is 5
The quotient is 3
The modulus is 1
SOURCE CODE: Update the source code below
#include<iostream>
using namespace std;
void addTwoNumbers(int , int); // function name for sum
// Create function name for product
// Create function name for difference
// Create function name for quotient
// Create function name for modulus
int num1, num2, sum=0; // global variable
main()
{
cout<<" *****************************************";
cout<<"\n * Name: *";
cout<<"\n * Section: *";
cout<<"\n *****************************************";
cout<<”Enter first number: “;
cin>> num1;
cout<<”Enter second number: “;
cin>> num2;
addTwoNumbers(num1, num2);
<insert your codes here>
}//end of main
//Calling Function addTwoNumbers
void addTwoNumbers (int a, int b)
{ sum= a + b;
cout<<"The sum is "<< sum;
}
OUTPUT: SCREEN SHOT AND PASTE YOUR OUTPUT
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)