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
Ganezh [65]
2 years ago
15

Do the same exercise but this time use the value returning function. Here is the skeleton of the main function. Write functions

definition according to the function call. Note: Do not change the main(). Copy it as it is. Must define the function after the main(). Make sure you write the function prototype before main(). // function prototype.
Computers and Technology
1 answer:
AfilCa [17]2 years ago
3 0

Answer:

The function prototypes are as follows:

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

The functions are as follows:

int findSum(int fn, int sn, int tn){

   return fn+sn+tn;}

int findMin(int fn, int sn, int tn){

   int min = fn;

   if(sn<=min && sn<=tn){

       min = sn;    }

   if(tn <= min && tn <= sn){

       min = tn;    }

   return min;}

int findMax(int fn, int sn, int tn){

   int max = fn;

   if(sn>=max && sn>=tn){

       max = sn;    }

   if(tn>=max && tn>=sn){

       max = tn;    }

   return max;}

Explanation:

Given

See attachment 1 for the main function

Required

Write the following functions

  • findSum
  • find Min
  • findMax.

The following represents the function prototypes

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

This declares the findSum function

int findSum(int fn, int sn, int tn){

This returns the sum of the three numbers

   return fn+sn+tn;}

This declares the findMin function

int findMin(int fn, int sn, int tn){

This initialzes min (i.e. minumum) to fn

   int min = fn;

This checks if sn is the minimum

<em>    if(sn<=min && sn<=tn){</em>

<em>        min = sn;    }</em>

This checks if tn is the minimum

<em>    if(tn <= min && tn <= sn){</em>

<em>        min = tn;    }</em>

This returns the minimum of the three numbers

   return min;}

This declares the findMax function

int findMax(int fn, int sn, int tn){

This initialzes max (i.e. maximum) to fn

   int max = fn;

This checks if sn is the maximum

   if(sn>=max && sn>=tn){

       max = sn;    }

This checks if tn is the maximum

<em>    if(tn>=max && tn>=sn){</em>

<em>        max = tn;    }</em>

This returns the maximum of the three numbers

   return max;}

<em>See cpp attachment for complete program which includes the main</em>

You might be interested in
How can you tell if your car is overheating?
Nitella [24]
A) your temp gauge is moving into red
4 0
2 years ago
Read 2 more answers
Why do we people have feelings and emotions<br> Please help
m_a_m_a [10]
Explanation:
People have feelings and emotions because evolved emotions as ways of helping us to rapidly reorganise our mental and bodily resources to help us prepare for anything the world might throw at us. During our lives, each of us experiences millions of emotional reactions either consciously or unconsciously.
Hope this helps
3 0
3 years ago
Read 2 more answers
What property do we use to distinguish a specific element from a form? value name click this
Andrews [41]
<span>If you match the physical properties of a substance you dont know about to the properties of a known substance, you now know what you've got. For example, if you know that compound X is bright yellow and screams when you poke it, an unknown sample that is yellow and screams that you poke it is probably compound X. trust me, im a dog in a suit.</span>
7 0
3 years ago
What level of system and network is required for cui
galben [10]

Answer:

CUI will be classified at a “moderate” confidentiality level and follow DoDI 8500.01 and 8510.01 in all DOD systems. Non-DoD systems must provide adequate security with requirements incorporated into all legal documents with non-DoD entities following DoDI 8582.01 guideline

Explanation:

6 0
3 years ago
In Bash, what commands can you use to view the contents of a document?
AlekseyPX

You can use the cat and less command to view the contents of a file.

hope this helps! :)

8 0
1 year ago
Other questions:
  • Ally made the net below to find the surface area of a box she was designing. The box measures 12 centimeters long by 9 centimete
    7·1 answer
  • What OS is most commonly used by businesses? Linux Macintosh Microsoft Windows
    11·1 answer
  • Which different supports from a part of the matte box?
    8·1 answer
  • Every time you are asked to work with others, you are being asked to:
    6·2 answers
  • The part of the computer that contains the brain, or central processing unit, is also known as the
    15·1 answer
  • Which cable would you check if you can't access any web pages?
    12·1 answer
  • My laptop volume has got really low all of a sudden. It wasn't the best to start with but now i can barely even hear it at 100%.
    10·1 answer
  • Write a program that passes an unspecified number of integers from command line and displays their total.
    5·1 answer
  • Which solution eliminates the need for dedicated high-speed WAN connections between sites
    5·1 answer
  • Simon would have regarded with impotent fury the disturbance between the North and the South, as it left his descendants strippe
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!