Question

I must call multiply, divide and remainder functions inside of SUBTRACT function.. I am stuck at...

I must call multiply, divide and remainder functions inside of SUBTRACT function.. I am stuck at this point. Thank you

#include<stdio.h>

int getDifference(int a, int b);
int main()
{
int a, b, result, multiply, divide, rem;

printf("Enter the two integer numbers : ");
scanf("%d %d", &a, &b);

//Call Function With Two Parameters

result = getDifference(a, b);
  

printf("Difference of two numbers is : %d\n" , result);
  
return (0);
}

int getDifference(int a, int b)
{
int c, multiply;
float rem, divide;

c = a - b;
return (c);


float rem ( int a, int b);
float divide( int a, int b);
int multiply (int a, int b);
  
}

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student,

below i written the C code as per the requirement.

Please note the below program has been tested on ubuntu 16.04 system and compiled using C compiler. This code will also work on other iDe;'

-----------------------------------------------------------------------------------------------------------------------------------

Program:

-----------------------------------------------------------------------------------------------------------------------------------

#include<stdio.h>

int getDifference(int a, int b);

float rem ( int a, int b);

float divide( int a, int b);

int multiply (int a, int b);

int main()
{

   int a, b, result, multiply, divide, rem;

   printf("Enter the two integer numbers : ");

   scanf("%d %d", &a, &b);

   //Call Function With Two Parameters

   result = getDifference(a, b);

   printf("Difference of two numbers is : %d\n" , result);

   return (0);
}

int getDifference(int a, int b)
{
   int c, mul;

   float r, d;

   c = a - b;

rem(a, b);

divide(a, b);

multiply(a, b);

mul = multiply(a, b);

   d = divide(a, b);

   r = rem(a, b);

   printf("The rem of two numbers is: %lf\n", r);

   printf("The divide of two numbers is: %lf\n", d);

   printf("The multiply of two numbers is: %d\n", mul);

return c;

}

//function defintions

float rem ( int a, int b)

{

return a%b;

}

float divide( int a, int b)

{

return a/b;

}


int multiply (int a, int b)

{

return a*b;

}


===============================================================

Output:

================================================================

Kindly Check and Verify Thanks...!!!

Add a comment
Know the answer?
Add Answer to:
I must call multiply, divide and remainder functions inside of SUBTRACT function.. I am stuck at...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write the functions to add, subtract, multiply and divide two doubles. The function returns the result...

    Write the functions to add, subtract, multiply and divide two doubles. The function returns the result on the operation. Write a program to test your functions. In visual studios console application C#.

  • Given an array of integer, please complete a function multiply(). The function accepts the first memory...

    Given an array of integer, please complete a function multiply(). The function accepts the first memory address of an array and the size of an array as parameters and returns the multiplication of all the elements. In order to get a full score, the function must use a loop to iterate through each element of an array. Pseudo code example:   multiply([ 1, 2, 3], 3) → 6   multiply([1, 1, 4 ,2], 4) → 8   multiply([7, 0, 0, 7, 0, 7],...

  • I am trying to change my code so i no longer need the function that reads...

    I am trying to change my code so i no longer need the function that reads in the users base and height input but rather uses the implementation of argument vector in C. I want to accept command line arguments and have it calculate my area. so i want to type this into the command line and have it calculate my area project1 5 4 #include <stdio.h> void userDimensions(float *base, float *height) { scanf("%f", base); scanf("%f", height); } float calcArea(float...

  • I need the programming to be in language C. I am using a program called Zybook...

    I need the programming to be in language C. I am using a program called Zybook Prompt: Write a statement that outputs variable numObjects. End with a newline. Given: #include <stdio.h> int main(void) { int numObjects; scanf("%d", &numObjects); return 0; } What I did so far. I am not sure if its right tho? #include <stdio.h> int main(void) { int numObjects; scanf("%d", &numObjects); printf(" num Objects is "); printf("%d\n", userAge); return 0; }

  • /* •   The following code consists of 5 parts. •   Find the errors for each part...

    /* •   The following code consists of 5 parts. •   Find the errors for each part and fix them. •   Explain the errors using comments on top of each part. */ #include <stdio.h> #include <string.h> int main( ) { ////////////////////////////////////////////////////////////////////////// //////////////        Part A. (5 points)                ////////////////// int g(void) { printf("%s", Inside function g\ n " ); int h(void) {       printf(" % s ", Inside function h\ n "); } } printf("Part A: \n "); g(); printf(" \n"); ////////////////////////////////////////////////////////////////////////// //////////////       ...

  • SEE THE Q3 for actual question, The first Two are Q1 and Q2 answers . Q1...

    SEE THE Q3 for actual question, The first Two are Q1 and Q2 answers . Q1 #include<iostream> using namespace std; // add function that add two numbers void add(){    int num1,num2;    cout << "Enter two numbers "<< endl;    cout << "First :";    cin >> num1;    cout << "Second :";    cin >>num2;    int result=num1+num2;    cout << "The sum of " << num1 << " and "<< num2 <<" is = "<< result;   ...

  • 1. Write code for a function that receives two parameters (a,and b) by value and two...

    1. Write code for a function that receives two parameters (a,and b) by value and two more parameters (c and d) by reference. All parameters are double. The function works by assigning c to (a/b) and assigning d to (a*b). The function has no return value. From main, use scanf to get two numbers, then call the function, and then display both outcome values to the output in a printf statement. 2. After part 1 is completed, write code to...

  • Please, I need help, I cannot figure out how to scan variables in to the function...

    Please, I need help, I cannot figure out how to scan variables in to the function prototypes! ******This is what the program should look like as it runs but I cannot figure out how to successfully build the code to do such.****** My code: #define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <math.h> #include <conio.h> float computeSeriesResistance(float R1, float R2, float R3); float computeParallelResistance(float R1, float R2, float R3); float computeVoltage(int current, float resistance); void getInputR(float R1, float R2, float R3); void getInputCandR(int...

  • Please help with this. Modify the program Figure 2.6 (exam1/exam2). Ask the user to enter two...

    Please help with this. Modify the program Figure 2.6 (exam1/exam2). Ask the user to enter two numbers Find the result when the first number is divided by the second Also find the remainder when the first number is divided by the second In other words, the program used to do this: 68 85 score = 81 Now it should do this 22 2 Divide = 11 Remainder = 0 If you run it again: 11 2 Divide = 5 Remainder...

  • I am told to find the median of random inputs using if statements in C #include...

    I am told to find the median of random inputs using if statements in C #include <stdio.h> #include <stdlib.h> int main() { double a, b, c, d; scanf("%lf", &a); scanf("%lf", &b); scanf("%lf", &c); if (a<b && b<c) d = b; printf("%.0f\n", d); else if (b<a && a<c) d = a; printf("%.0f\n", d); else d = c; printf("%.0f\n", d); return 0; } That is my code, I keep getting an error for the else if and else saying there is no...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT