Answered step by step
Verified Expert Solution
Question
1 Approved Answer
functions. Write a program that calculates multiplication and division operations through The function that calculates multiplication takes 2 positive integer numbers as parameters and
functions. Write a program that calculates multiplication and division operations through The function that calculates multiplication takes 2 positive integer numbers as parameters and display the result of the multiplication. One of the parameters is the multiplicand and the other one is the multiplier. This function calculates the result of the multiplication by calculating the sum of the multiplicand value multiplier value times. E. g: Let's say the function is about to calculate the multiplication of 3 and 4. 0+3=3 3+3-6 6+3-9 repeats 4 times because multiplier is 4. 9+3-12 result The function that calculates division takes 2 positive integer numbers as parameters. One of the parameters is the numerator and the other one is the denominator. In this function subtract the denominator value from the numerator value until the numerator value is less than the denominator value and count how many times these operations happens. Then display the count as the result of the division and the newly calculated numerator value as the remainder value of the division as in the Sample Run 2. E. g: Let's say the function is about to calculate the division of 7 to 2. 7-2=5 5-2=3 3-2-1 remainder value repeated 3 times division result is 3. In the main function get two integer value and a character value from the user as in the sample runs and call the desired function. If the character value is *, it calls the multiplication function with sending its integer parameters to this function and display the result as in the Sample Run 1. If the character value is '/', it calls the division function with sending its integer parameters to this function. If the character value is none of them displays an error message as in the Sample Run 3. Sample Run 1: Enter two integer values:3 4 Enter the operation character:" Result of the multiplication is 12 Sample Run 2: Enter two integer values:7 2 Enter the operation character:/ Result of the division is 3 and the remainder is 1 Sample Run 3: Enter two integer values:3 5 Enter the operation character:t Error! Undefined operation.
Step by Step Solution
★★★★★
3.34 Rating (160 Votes )
There are 3 Steps involved in it
Step: 1
code include void multiplicationint a int b function to print the multiplication of two numbers int ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started