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
rodikova [14]
3 years ago
8

Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t

hree values. If the input is 7 15 3, the output is: largest: 15 smallest: 3 Your program should define and call two functions: Function LargestNumber(integer num1, integer num2, integer num3) returns integer largestNum Function SmallestNumber(integer num1, integer num2, integer num3) returns integer smallestNum
Computers and Technology
1 answer:
Monica [59]3 years ago
7 0

Answer:

int SmallestNumber(int num1, int num2, int num3){

int smallest;

if (num1 >num2){

smallest=num2;

}

else {

smallest=num1;

}

if(smallest <num3){

smallest=num3;

}

}

int LargestNumber(int num1, int num2, int num3){

int largest;

if (num1 <num2){

largest=num2;

}

else {

largest=num1;

}

if(largest>num3){

largest=num3;

}

}

void main(){

int num1,num2,num3;

printf("enter values");

scanf("%d%d%d",&num1,&num2,&num3);

int smallest=SmallestNumber(num1,num2,num3);

int largest=LargestNumber(num1,num2,num3);

}

Explanation:

we are comparing first two numbers and finding largest among those. After getting largest comparing that with remaining if it is greater then it will be largest of three. Same logic applicable to smallest also

You might be interested in
How does a author develop a character in a story?
Eva8 [605]
Sometimes they base them off their selves or others they know
3 0
4 years ago
Read 2 more answers
Look at the slide.
svetlana [45]

Answer:

c

Explanation:

5 0
3 years ago
Read 2 more answers
A teacher uses the spreadsheet below to determine the average quiz score of each student. The teacher inserts this information i
Vinvika [58]

need help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

6 0
4 years ago
Read 2 more answers
Describe two benefits of the community of replacing the printed copy with an online version.
DiKsa [7]

Answer:

less costs

Explanation:

saves more money

easy to use for everyone

6 0
3 years ago
Juan has performed a search on his inbox and would like to ensure that the results only include those items with
lubasha [3.4K]

Answer:

The Refine command group

Explanation:

8 0
3 years ago
Other questions:
  • Write a java program called allDigitsOdd that returns whether every digit of a positive integer is odd. Return true if the numbe
    6·1 answer
  • Your boss wants you to devise a way for remote contractors to be able to access the server desktop. There is one stipulation, ho
    8·2 answers
  • Which hexadecimal-type address refers to a physical networking device such as a network interface card?
    10·1 answer
  • Use ONE SQL statement to show the total number of actual hours for each customer. In the output, show customer id and the total
    15·1 answer
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • Pls help due tonight<br>Will give brainiest
    13·2 answers
  • Assume the following:
    10·1 answer
  • The physical layer of the OSI model is not foundational to any of the other layers. True or False
    8·1 answer
  • If you need any answer answered faster check out Wolframalpha.com
    14·2 answers
  • Did you know you can buy a Passport Online?
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!