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
alukav5142 [94]
3 years ago
15

Write a C program that includes a function of type double called divemaster accepts two double arguments (you must write the div

emaster function). When called, your function will return the first argument divided by the second argument. Make sure your function includes a decision statement so that it can't divide by 0--if the caller attempts to divide by 0 the function should return a value of -1.0.
Computers and Technology
1 answer:
Firlakuza [10]3 years ago
6 0

Answer:

Following is the C program to divide two numbers:

#include<stdio.h>

double divemaster (double first, double second)

{

//Check if second argument is zero or not

if(second!=0)

    return first/second;

else

 return -1.0;

}

int main()

{

printf("%f\n", divemaster(100,20));

printf("%f\n", divemaster(100,0));

}

Output:

5.000000

-1.000000

Explanation:

In the above program, a function divemaster is declared which divedes the first argument with second and return the result.

Within the body of divemaster function if else block is used to verify that the  second argument is not zero, and thus there is no chance of divide by zero error.

In main two printf statements are used to call the divemaster function. One to check normal division process and second to check divide by zero condition.  

You might be interested in
Select the correct category of cybersecurity described.
Shalnov [3]

Answer:

Network security

Explanation:

Network security is a category of cybersecurity that is related to the protection of the infrastructure of the computer network from unauthorized access and intrusion that may be from intended attack or from an expedient  program which may result in the modification, malfunctioning, misuse or unacceptable disclosure of the network and the contents of the network

The category of cybersecurity that 'prevents intruders from accessing, misusing, destroying, adapting, or improperly disclosing networks, network infrastructure, or the information contained within networks' is network security.

6 0
2 years ago
An attribute that can have more than one value for each entity instance is referred to as:
ss7ja [257]

Answer:

D) a multivalued attribute

Explanation:

A multivalued attribute  can have more than one value associated with the entity key.

6 0
3 years ago
The _______ displays the data series in separate columns side-by-side so that you can compare the relative heights of the column
k0ka [10]

Answer:

Cluster Column Charts.

Explanation:

Clustered column chart:-It displays multiple data series in separate vertical columns. Each series have the same axis labels.Clustered vertical columns thus allow direct comparison of multiple data series.When having three data series you can compare their heights also.So we conclude the answer is Cluster Column Charts.

3 0
3 years ago
Read 2 more answers
If a printer is not Wi-Fi capable, how can it be set up to provide the most reliable wireless printing
SCORPION-xisa [38]

Answer:

Well you can use bluetooth since it doesn’t require wifi and it would still work if your printing a file from your computer or your flash drive.

5 0
2 years ago
Read 2 more answers
A client has an issue with large files taking a long time to open or save. As time goes by, the issue worsens. The client has hu
Daniel [21]

Answer:

B. Perform a scan of the drive for file fragmentation

Explanation:

When files are deleted from a drive chunks might be left behind, so over time there's chucks scattered around. When new files are added, they are also scattered around into the gaps left by the fragments (chunks of files scattered around the drive) making it harder to read for the system especially because they are large files. So the Hard drive has to be defragmented to rearrange the chucks and allow files to be easily read.

8 0
3 years ago
Other questions:
  • How do multi-cellular organisms develop?
    9·1 answer
  • An operating system coordinates the BLANK of a computers operation.
    7·2 answers
  • Meg is in the process of creating a storyboard for her personal website, but she is unable to decide which storyboarding techniq
    10·1 answer
  • 2. Student organizations sometimes require transportation for off-campus activities, and school policy requires students to be o
    11·1 answer
  • Wireless attacks avoid the access points to limit detection. <br> a. True <br> b. False
    9·1 answer
  • Which term refers to a type of an attack in which an attacker makes his data look like it is coming from a different source addr
    10·1 answer
  • Allowing every communication is a bad idea from a security standpoint as well as a productivity one.TrueFalse
    15·1 answer
  • Saving a file as a new filename can be accomplished through the Save As dialog box.
    13·1 answer
  • When you start a new blank document, you begin typing at the
    6·1 answer
  • The software concept ___________and defines a need for the new system.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!