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
Express the following binary numbers in hexadecimal. (a) %100011100101 (b) %1011001111 (show work)
Lapatulllka [165]

Answer:

(100011100101)_{2} = (8E5)_{16} = %8E5

(1011001111) = (2CF)_{16} = %2CF

Explanation:

Binary and hexadecimal values have the following pair equivalences.

(0000)_{2} = (0)_{16}

(0001)_{2} = (1)_{16}

(0010)_{2} = (2)_{16}

(0011)_{2} = (3)_{16}

(0100)_{2} = (4)_{16}

(0101)_{2} = (5)_{16}

(0110)_{2} = (6)_{16}

(0111)_{2} = (7)_{16}

(1000)_{2} = (8)_{16}

(1001)_{2} = (9)_{16}

(1010)_{2} = (A)_{16}

(1011)_{2} = (B)_{16}

(1100)_{2} = (C)_{16}

(1101)_{2} = (D)_{16}

(1110)_{2} = (E)_{16}

(1111)_{2} = (F)_{16}

We convert from binary to hexadecimal selecting groups of 4 binary from the binary code, from the least significant bits(at the right) to the most significant bits(at the left). The conversion is an hexadecimal "string" from the last group you converted to the first. So:

(a) %100011100101

(0101)_{2} = (5)_{16}

(1110)_{2} = (E)_{16}

(1000)_{2} = (8)_{16}

So

(100011100101)_{2} = (8E5)_{16}

(b) %1011001111

(1111)_{2} = F_{16}

(1100)_{2} = C_{16}

(10)_{2} = (0010)_{2} = 2_{16}

(1011001111) = (2CF)_{16}

7 0
3 years ago
Each computer on a network requires a unique way to identify itself and to refer to other computers. This is accomplished by usi
monitta

Answer: True

Explanation: I would know i have gotten dosed plenty of times on video games

4 0
3 years ago
Read 2 more answers
Create a Racket procedure compute_pos that reads numbers from the keyboard until 0 is read, count how many positive numbers are
Artyom0805 [142]

Answer:

import java.util.Scanner;

public class Solution {

   public static void main(String args[]) {

       compute_pos();

     }

     

     public static void compute_pos(){

     Scanner scan = new Scanner(System.in);

     int sum = 0;

     int counter = 0;

     // Prompt the user to enter an input

     System.out.println("Enter your value");

     // user input is assign to the variable value

     int value = scan.nextInt();

     

     while(value != 0){

         if (value > 0){

             sum += value;

             counter++;

         }

         System.out.println("Enter your value");

         value = scan.nextInt();

     }

     // Display the value of sum to the user

     System.out.println("The sum of the positive number is: " + sum);

     // Display the value of counter to the user

     System.out.println("The number of positive number is: " + counter);

   }

}

Explanation:

The first line import the Scanner class which allow the program to read input from the user. The class Solution is then defined. Then the main method which signify the beginning of execution in the program is defined. A method is called inside the main method.

The method compute_pos is defined. Inside the compute_pos method, a scanner object scan is declared to accept input from the user via the keyboard.

The variable sum and counter is declared and assigned to 0.

A prompt is displayed to the user to input a value. The user input is accepted and stored in the variable value.

Then a while loop is use to check the user input if it is not equal to zero. If it is equal to zero, the loop will end. Inside the loop, we first check to see if the user input is greater than 0, if it is, we add it to the variable sum and increase our counter by 1. At the end of the loop, a prompt is again display to accept input from the user.

Outside the loop, we display the sum and counter to the user.

8 0
4 years ago
Could anyone beat my typing?<br><br> https://keyma.sh/custom/33K7C
insens350 [35]

Answer:

This should not be typed in brainly. Brainly is for answering questions

Explanation:

8 0
3 years ago
Susan is a network administrator and is setting up her company's network. In the process to determine an open port on a firewall
Dovator [93]

Answer:

poop head is big butt

Explanation:

soorru

4 0
2 years ago
Other questions:
  • Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
    8·2 answers
  • You are researching RAM for a computer you are building for a friend who will be using the system as a home office server for he
    13·1 answer
  • In javascript, what can I put after player. to make my character go in the center of the screen? like example:
    10·1 answer
  • What does IDLE stand for
    11·2 answers
  • Accenture has put together a coalition of several ecosystem partners to implement the principles of blockchain and Multi-party S
    5·1 answer
  • A python program for the following output using for loop.
    13·1 answer
  • What profession do you prefer to have in the future? In what way could you make an impact on society using the Internet?
    7·1 answer
  • Do you have any sprites for Friday Night Funkin?
    14·1 answer
  • Help me with the question please..​
    6·1 answer
  • Which of the following protocols is used by an email client to retrieve messages from an email server, giving users the option t
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!