1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
oee [108]
4 years ago
13

Write the definition of a function divide that takes four arguments and returns no value . The first two arguments are of type i

nt . The last two arguments arguments are pointers to int and are set by the function to the quotient and remainder of dividing the first argument by the second argument . The function does not return a value .The function can be used as follows:int numerator=42, denominator=5, quotient, remainder;divide(numerator,denominator,&quotient,&remainder);/ quotient is now 8 // remainder is now 2 /
Computers and Technology
1 answer:
likoan [24]4 years ago
4 0

Answer:

The following function definition is from C++ programming language.

//define function with arguments

void divide (int numerator, int denominator, int *quotient, int *remainder)

{

*quotient = (int) (numerator/denominator);

*remainder = numerator % denominator;

}

Explanation:

Here, we define a void data type method "divide()" with four arguments in which first two arguments are integer type variables "numerator" and "denominator", next two are pointer type variables "quotient" and "remainder".

After that, we divide the first two integer variables and save result in "*quotient" then, we again use these variables for modulation and save result in "*remainder".

You might be interested in
Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the elemen
Verdich [7]

Answer:

Replace <STUDENT CODE> with

for (i = 0; i < SCORES_SIZE; ++i) {

       if(lowerScores.at(i)<=0){

           lowerScores.at(i) = 0;

       }

       else{

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Explanation:

To do this, we simply iterate through the vector.

For each item in the vector, we run a check if it is less than 1 (i.e. 0 or negative).

If yes, the vector item is set to 0

If otherwise, 1 is subtracted from that vector item

This line iterates through the vector

for (i = 0; i < SCORES_SIZE; ++i) {

This checks if vector item is less than 1

       if(lowerScores.at(i)<1){

If yes, the vector item is set to 0

           lowerScores.at(i) = 0;

       }

       else{

If otherwise, 1 is subtracted from the vector item

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Also, include the following at the beginning of the program:

<em>#include <vector></em>

8 0
3 years ago
Hello! I am a new coder, so this is a simple question. But I am trying to create a code where you enter a number, then another n
slavikrds [6]

no longer returns an error but your math seems to have something wrong with it, always returns 0

Console.WriteLine("Enter a percentage here");

   int Percent = int.Parse(Console.ReadLine());

   Console.WriteLine("Enter your number here");

   int Number = int.Parse(Console.ReadLine());

   int result = Percent / 100 * Number;

6 0
3 years ago
Which one of the following pieces of information would be allowed as part of a limited data set?
Inessa05 [86]
Phone number would be allowed
6 0
4 years ago
Although the first GPS satellite was put into orbit in the ___________, GPS did not provide global coverage until _______.
Ilia_Sergeevich [38]
February 22 1978 and 1992 
5 0
3 years ago
For a panoramic photograph, you will more than likely want to control the exposure of the photograph yourself rather than lettin
Ronch [10]
When shooting panoramic you would want to control the exposure yourself, much rather than the camera..... A panoramic is one big picture correct, so you would want all of them to be the same exposure level, now some cameras may lock on, and others may not......your correct answer would be TRUE does this make sense?
8 0
4 years ago
Other questions:
  • In project integration management, project ______ and _______ are intertwined and inseparable activities
    14·1 answer
  • Remy’s manager has asked him to change the background color scheme from reds to blues in the standard template the company uses
    15·2 answers
  • How is a ink pen better than a digital pen.
    8·1 answer
  • Please write a code for below:
    9·1 answer
  • Fair Use means a teacher can take the contents of a web activity page and repost it in your school's web site because it is for
    7·1 answer
  • Which statement reflects an opinion about technology? Select all that apply. Select one or more: a. It is easy to imagine that a
    5·1 answer
  • Explain the reason why vector graphics are highly recommended for logo​
    5·1 answer
  • I CANT DO SKIN MODS ON BRAWLHALLA RIGHT!!!! IM SO MADDDDDDDDDDD
    11·1 answer
  • This is a human-made physical system.
    15·1 answer
  • The address for the website you want to visit is called the browser internet URL World Wide Web
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!