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
Goryan [66]
3 years ago
10

Write a program that displays the middle value of three unduplicated input values. Hint: Review the four solutions in the smalle

st number case study in this chapter. Consider how easy or hard it would be to modify each of those algorithms to find the middle value rather than the smallest value. Then modify the algorithm you consider most appropriate for this problem.
Computers and Technology
1 answer:
kkurt [141]3 years ago
5 0

Answer:

The code is in java.

Explanation:

import java.util.Scanner;  

class Main{  

   public static void main(String[] args) {

       System.out.println("Enter 3 different numbers");

       Scanner obj = new Scanner(System.in);

       int a = obj.nextInt();

       int b = obj.nextInt();

       int c = obj.nextInt();

       System.out.println("The middle element is : ");

       //Check if a is the middle

       if(a>b&&a<c || a>c&&a<b){

           System.out.println(a);

       }

       //Check if b is the middle element

       else if(b>a&&b<c || b<a&&b>c){

           System.out.println(b);

       }

       else{

           System.out.println(c);

       }

   }

}  

OUTPUT:-

You might be interested in
____ refers to typing your entire e-mail message or discussion group post using only capital letters.
Over [174]
The answer to this question is: Shouting
7 0
3 years ago
Normal view
Amiraneli [1.4K]
Normal View is the place where creating and editing occurs slide panel. This is where you can write or edit kind of information or images you wanted to show in your power point presentation. 
3 0
3 years ago
Read 2 more answers
_____ crime involves the use of computers and the internet to commit acts against people, property, public order, or morality. v
den301095 [7]
Hi,


Answer => Cyber


Good Lessons
6 0
4 years ago
In this lab you will learn about the concept of Normal Forms for refining your database design. You will then apply the normaliz
noname [10]

Answer:

I don't know

Explanation:

is about knowing how to make use of the refinery

7 0
3 years ago
ven int variables k and total that have already been declared, use a while loop to compute the sum of the squares of the first 5
monitta

Answer:

Following are statement is given below

int  k=1,total=0; // variable declaration

while(k<50) // iterating the while loop

{

   total=total+k*k;//  calculating the square

   k=k+1; // increments the value of k by 1    

}

Explanation:

Following are the description of Statement.

  • Declared a variable "total" and "k" of the "integer " type initialized the total to 0 and "k" to 1.
  • Iterating the while loop for less then 50 .In this loop, we calculating the sum of square of first 50 number in the "total" variable .
  • After that increment the value of "k" variable by 1 to execute the loop less then 50 .

3 0
3 years ago
Other questions:
  • A database interrogation is a major benefit of the database management approach, where end users can query (“ask”) the database
    6·1 answer
  • For this lab, youhave to write a programnamedseriesFunction.cthat prompts user to enter two values, x and n. Then it would use a
    11·1 answer
  • What is a type of destructive program?
    8·2 answers
  • T.J. wants to send a friend a file with a funny dancing cat. Which file format should T.J. use?
    13·2 answers
  • Match the keyword to its definition. 1 . Pixel A device that is not central to the operations of a computer 2 . Peripheral Stand
    10·1 answer
  • Methods can be ____ correctly by providing different parameter lists for methods with the same name.
    7·1 answer
  • Rachael has been posting negative comments on several of her peers' social media pages. Which of the six Ps is Rachael abusing?
    15·1 answer
  • Which wildcard characters will return a single character when using the Find dialog box?
    6·2 answers
  • LAB: Even/odd values in an array
    9·2 answers
  • In general, the outside _____ and sleeves of the isolation gown and outside front of the goggles, mask, respirator and face shie
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!