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]
2 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]2 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
A(n) _______ is the most basic type of access query
san4es73 [151]
Select Query
I hope this helps! :)
4 0
2 years ago
The engine flywheel bolts to the Rotor Pistons Front axle Crankshaft
swat32
The answer is D. Crankshaft.  The flywheel is connected to the crankshaft. The crankshaft<span> is </span>connected<span> to the pistons and moves in a circular motion to move the engine. Spark Plugs are based at the top of the pistons, this is used to ignite fuel in the pistons that move them. The timing belt is </span>connected to the crankshaft<span> and it rotates the camshaft. </span>
5 0
3 years ago
Do rats smell good? what do you think
irina1246 [14]

Answer:

Rats are not smelly animals. They are actually extremely clean animals and should not smell bad at all. ... A sick rat odor will smell like infection. Most likely if you are smelling your rats it is due to the cage and bedding not being cleaned often enough or from using the wrong type of litter and bedding.

Explanation:

7 0
3 years ago
Read 2 more answers
What is a current Gdp and what is a real Gdp?
SpyIntel [72]
Do u mean GPD? OORRR
5 0
2 years ago
Read 2 more answers
Consider the following pseudocode:
In-s [12.5K]

Answer:

Part a:  The program will print 3.

Part b: The program will print 4

Part c: The program will print 1.

Explanation:

Part a: As the scoping is static, the x integer has a value of 1 and the y integer has a value of 2 so the addition is 2+1=3.

Part b: As the scoping is dynamic with deep binding, the x integer has a value of 2 and the y integer has a value of 2 so the addition is 2+2=4.

Part c: As the scoping is dynamic with shallow binding, the x integer has a value of 1 so it will print 1.

4 0
3 years ago
Other questions:
  • A ____ network (or workgroup) consists of multiple windows computers that share information, but no computer on the network serv
    15·1 answer
  • A network administrator is required to upgrade wireless access to end users in a building. To provide data rates up to 1.3 Gb/s
    12·1 answer
  • What are the top and side margins for a letter typed in standard format?
    5·1 answer
  • Why is population composition by age important give reason​
    13·1 answer
  • Why are answers not appearing? I've seen many complain about this recently.
    8·1 answer
  • How do you create a formula in excel​
    10·1 answer
  • A(n) ________ is a chart based on PivotTable data.
    15·1 answer
  • How each programming language differs in terms of constructs, techniques, use and requirements?
    9·1 answer
  • _____ oversee the work of various types of computer professionals and must be able to communicate with people in technical and n
    5·1 answer
  • What command utilizes the limpel-ziv (lz77) compression algorithm and achieves a compression ratio of 60-70 percent?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!