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
tester [92]
3 years ago
8

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:
Nastasia [14]3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

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

{

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

*remainder = numerator % denominator;

}

int main()

{

int num = 42, den = 5, quotient=0, remainder=0;

divide(num, den, &quotient, &remainder);

 

return 0;

}

Explanation:

The exercise is for "Call by pointers". This technique is particularly useful when a variable needs to be changed by a function. In our case, the quotient and the remainder. The '&' is passing by address. Since the function is calling a pointer. We need to pass an address. This way, the function will alter the value at the address.

To sum up, in case we hadn't used pointers here, the quotient and remainder that we set to '0' would have remained zero because the function would've made copies of them, altered the copies and then DELETED the copies. When we pass by pointer, the computer goes inside the memory and changes it at the address. No new copies are made. And the value of the variable is updated.

Thanks! :)

You might be interested in
A _________ provides multiple ports for connecting nodes and is aware of the exact address or identity of all the nodes attached
Novosadov [1.4K]
The word you are looking for is "hub".
5 0
3 years ago
Read 2 more answers
What read a page on website​
katovenus [111]

Answer:

Dino

Explanation:

3 0
3 years ago
Which of the following is true about strings?
pickupchik [31]

Answer:

Your answer is option C, or the third option.

They do not let the user type in letters, numbers, and words.

Explanation:

Strings are defined as a sequence of characters literal, constant, or variable. These sequences are like an array of data or list of code that represents a structure. Formally in a language, this includes a finite(limited) set of symbols derived from an alphabet. These characters are generallu given a maximum of one byte of data each character. In longer languages like japanese, chinese, or korean, they exceed the 256 character limit of an 8 bit byte per character encoding because of the complexity of the logogram(character representing a morpheme((which is the simpliest morphological(form or structure) unit of language with meaning)) character with 8 bit (1 byte, these are units of data) refers to cpu(central processing unit) which is the main part of a computer that processes instructions, and sends signals.

5 0
3 years ago
Several years ago, Jaime began to operate a small home business. He was very excited by the new features of Windows 95. These ne
Dmitriy789 [7]

1. A complete operating system rather than a graphical user interface running on top of MS-DOS.

After boot up, the system completely run without MS-DOS environment.

2. Improved windows control and appearance of windows

Windows 95 has a new system control that located on the upper left corner of each window as an icon. In the upper right of each window, it has a new designed system box. Usually, it displays "Minimize", "Maximize/Restore" and new added "Close" buttons.

3. New introduced Desktop

Not only to store minimized icons, Windows desktop in Windows 95 can store files, shortcuts and system icons such as "My Computer" and "Recycle Bin".

4. Right button menu

Right click an object in system usually can bring a pop-up menu with some items like "edit", "copy", "paste", "properties" and "help".

5. New help system

The help window can resize and jump to anywhere in the screen. It splits to two areas in which left side is the index or keyword window and the right side is the content window.

6. Task bar and start menu

Similar to the concept of reserved area in Windows 1.x, Windows 95 began to have a task bar to store the links that can active or inactive an running program and display some system information in the tray area. A start menu was include in the task bar can let user access the shortcuts to all programs in a tree structure menu system.

7. Build-in network support with dial-up for different protocols

The build-in dial-up with support of TCP/IP protocol made user easier to access Internet. In OSR2 version of Windows 95, Microsoft began to integrate Microsoft Internet Explorer in Windows 95.

8. Folder view of all kinds of files and resources

In Windows 95, files, drives, shortcuts and network resources can all be displayed in a folder view in the new Windows Explorer which replaced Program Manager in pervious version of Windows.

9. Support of 32 bit application, pre-emptive multitasking and thread

These functions made Windows 95 to have the ability to run more complex tasks and programs.

3 0
3 years ago
A troubleshooting strategy that removes components from a system in order to get back to a basic configuration is called module
Semmy [17]

Answer:

B. False.

Explanation:

Troubleshooting strategy is a technique used to discover the cause of defeat in a system. The technician must learn to improvise with these strategies to solve a system problems.

Module replacement is a type of troubleshooting strategy that replaces a component with unknown status with another component with good status to determine the cause of the problem.

Removing a component from a system to get back to its basic configuration helps to eliminate factors that may make a computer problem difficult to solve.

3 0
3 years ago
Other questions:
  • What does CMOS stand for?
    15·2 answers
  • Write a program that asks the user for the name of a text file. the program should display the last 10 lines of the file on the
    13·1 answer
  • What is 1/2 minus 1/16?
    7·2 answers
  • How do I do a PowerPoint
    10·2 answers
  • 50 POINTS PLEASE HELP MEEEEEEEEE!!!!!!
    7·2 answers
  • Write a program that reads from a file called dictionary.txt which contains pairs of English and translated words separated by a
    12·1 answer
  • : How can Internet technologies help a business form strategic alliances with its customers, suppliers, and others?
    10·1 answer
  • True or false we can used virus not use pirated software and programs ​
    10·1 answer
  • What program command saves a copy of a file under a different name
    14·1 answer
  • Which directory stores the cron configuration file?.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!