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
Elenna [48]
4 years ago
13

Write a conditional statement that will sort three numbers or strings. Display the results on the webpage.

Computers and Technology
1 answer:
Pachacha [2.7K]4 years ago
8 0

Answer:

<html>

<body>

<button onclick="sort1()">sort me</button>  

<script>

var a=45;

var b=-1;

var c= 44;

function sort1() // function sort1

{

if (a>b && a>c)

{

       if (b>c)

       {

           console.log(a + ", " +  b + ", " +c);

       }

       else

       {

           console.log(a + ", " + c + ", " +b);

       }

}

else if (b>a && b >c)

{

       if (a>c)

       {

            console.log(b + ", " + a + ", " +c);

       }

       else

       {

            console.log(b + ", " + c + ", " +a);

       }

}

else if (c>a && c>b)

{

       if (a>b)

       {

           console.log(c + ", " + a + ", " +b);

       }

       else

       {

           console.log(c + ", " + b + ", " +a);

       }

}  

}      

}

Output:

45 44 -1

</script>

</body>

</html>

Explanation:

In this we create a program in javascript so we create a three variable in the function sort1() the variable i.e a,b,c after that check the condition if (a>b && a>c) In this it check if variable "a>b "and it is also greater then c then it check   check for "b>c"  if "b>c" then it print the value of "a,b,c" otherwise print" a,c,b" similarly other conditional statement will check display the required output in webpage .

You might be interested in
What is Game Theory?
AleksandrR [38]

Answer:

the branch of mathematics concerned with the analysis of strategies for dealing with competitive situations where the outcome of a participant's choice of action depends critically on the actions of other participants

Explanation:

In simple terms Game theory is the study of how and why people make decisions.

8 0
3 years ago
Glven an array named Scores with 25 elements, what is the correct way to assign the 25th element to myScore? A. myScores + 25 B.
Marat540 [252]

Answer:

myScore Scores[24]

Explanation:

The array is used to store the data in continuous memory location.

The index of array start from zero, it means first element store in the index zero and second element store in the index 1. So, the index at which the element store is less than 1 from the number of element.

so, the last element is 25 - 1=24.

Option A: myScores + 25

It is not the correct way to store the element.

Option B: myScore Scores[24]

it is the correct form and also the index location is correct.

Option C: myScore Scores[25)

index number is wrong and also the bracket is wrong, it must be [ ].

Option D: myScore== Score[last]

It is not the correct way to store the element.

There, the correct option is B.

6 0
3 years ago
i want to write a program that display that pattern *********** *********** *********** *********** *********** *********** ****
kodGreya [7K]
Im sorry, but for me to answer the question, I need the full question
4 0
4 years ago
Which of the following is an example of an output device on a smartphone?
Andru [333]

Answer:

The speaker

Explanation:

Speakers are output devices because the audio is taken from the app or website and playing it towards the speakers.

7 0
3 years ago
The valence electron configurations of several atoms are shown. how many bonds can each atom make without hybridization? 2s^2 2p
Pie
Answer: This element needs 3 electrons to complete its octet state

Why?:
since the electrons in 2s2 are already paired they cannot form a bond pair with electrons from other elements without hybridisation however the 3 electrons in 2p3 are unpaired so can form bond pairs with electrons from other elements without hybridisation.

Hope this helps!
3 0
4 years ago
Other questions:
  • The text discusses three different steps when processing input. Which of the following is (are) one of those steps? (Check all t
    8·1 answer
  • What are the four elements of game design?<br><br> Help Me!!
    9·1 answer
  • What is data and imformation?​
    6·1 answer
  • I have a question. This question will probably be deleted, but why do moderators keep deleting my answers when they are legitima
    13·1 answer
  • Step into my world
    7·2 answers
  • What is wrong with a MOV BL, CX instruction?
    6·1 answer
  • A system analyst generally needs to have a number of skills. For example, technical and analytical skills are required for this
    7·1 answer
  • 2. It enables you to gather data on a specific topic. *a.Interviewb.Questionnairec.Surveyd.Research
    14·1 answer
  • What is the difference between packaged and tailored software ​
    13·1 answer
  • Write a program that will make a copy of a text file, line by line. Read the name of the existing file and name of the new file(
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!