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
Please help!
Nesterboy [21]
I think it the answer would be B but I'm not sure
4 0
3 years ago
Read 2 more answers
Does anyone have code hs circle pyramid 2.0?
Andrews [41]

Answer:i dont

Explanation:

8 0
2 years ago
*****HELP******
trasher [3.6K]

Answer:

True

Explanation:

The Most Favored Nation (MFN) status and national treatment are provided for in article 4 of the Trade Related Aspects of Intellectual Property Rights (TRIPS) Agreement and it is stated that when a member grants favor, advantage, immunity , or privilege to citizens of a country, the country shall grant similar favor, privileges and advantages to the citizens of the other members

Therefore;

<em>True</em> Most Favored Nation (MFN) status and national treatment are also included in the Agreement on Trade-Related Aspects of intellectual Property Rights (TRIPS).

5 0
3 years ago
ABC Manufacturing Company is located in Hiroshima, Japan. Being prone to earthquakes, the company decided to implement a backup
maxonik [38]

The command interface protocol that I would suggest to the IT administrator is Secure Shell (SSH).

<h3>What is a command interface protocol?</h3>

A command interface protocol can be defined as a standard protocol that is designed and developed to processes commands in the form of lines of text to a software program that is installed on a computer system.

<h3>The types of command interface protocol.</h3>

In Computer technology, there are different types of command interface protocol and these include:

  • SSL
  • TLS
  • SSH

SSH is an acronym for Secure Shell and it is a standard network protocol that gives a IT administrator a secure way to access data over an unsecured network, especially when backing up data.

Read more on SSH here: brainly.com/question/17147683

7 0
1 year ago
List out the input and output device .​
Dmitry [639]

Computer - Input Devices

Keyboard.

Mouse.

Joy Stick.

Light pen.

Track Ball.

Scanner.

Graphic Tablet.

Microphone.

Computer - Output Devices

Monitor.

Printer.

Headphones.

Computer Speakers.

Projector.

GPS.

Sound Card.

Video Card.

5 0
3 years ago
Read 2 more answers
Other questions:
  • Lydia used software and numerical data to create bar graphs. What software did she use?
    8·2 answers
  • A department manager would like to choose an access control model in which the owner of a resource decides who may modify permis
    8·1 answer
  • software that provides capabilities common across all organizations and industries is known as ________ software.
    15·2 answers
  • ProcessName2
    9·1 answer
  • The part of the computer that provides access to the Internet is the
    11·1 answer
  • A heart murmur is caused by incorrect operation of ________?​
    7·1 answer
  • Write the name of main ore of silver.Write any two application of sliver​
    14·1 answer
  • nts/viewer/classes/289ef1a5d7c341c284010 Select the compound inequality shown on the graph. 5 4 3 2 1 0 1 2 를 4​
    6·1 answer
  • How to print something nad input on same line python
    8·1 answer
  • I need the full code for 6.1.3 code hs circles and squares please answer please help
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!