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
Which one of the following is true about employer responsibility in providing fall protection to workers? not selected A. Employ
Luda [366]

Option B is the correct answer, Employers have flexibility in choosing a fall protection system they believe will work best in a situation selected. It is the primary duty of employer to provide safety to its workers. Employers must setup a suitable protection system at workplace from falling off from overhead platforms and from elevated workstations during construction for safety of its employees.  

Further Explanation:

⦁ Employer must ensure compliance to OSHA-Fall protection in construction.

⦁ Generally, fall protection must be ensured by deploying guardrail systems at the edge of construction sites, safety systems built by nets or personal fall arrest.

⦁ OSHA requires to built fall protection system irrespective of fall distance to make sure safety conditions for workers/ employees.

Answer details:

Grade: High School

Subject: Computer Science and Technology.

Learn More:

Fall protection and compliance to OSHA rules and regulations

brainly.com/question/8910167

Employer responsibility in providing fall protection

brainly.com/question/5872956

Key Words: Fall protection, OSHA, workplace safety, guardrail systems etc.

Image of guardrail as an example is attached.

5 0
4 years ago
Read 2 more answers
What term is used for a seemingly harmless program that has malicious code hidden inside?
Delicious77 [7]
That is none other than a "Trojan Horse"
8 0
4 years ago
What are the third generation of computer?​
balu736 [363]

The period of third generation was from 1965-1971. The computers of third generation used Integrated Circuits (ICs) in place of transistors. A single IC has many transistors, resistors, and capacitors along with the associated circuitry. The IC was invented by Jack Kilby.

3 0
3 years ago
Read 2 more answers
Match the definition with the correct term: Closeness to the true value of a measurement
LenKa [72]
Closeness to the true value of a measurement is accuracy
7 0
4 years ago
Explain briefly in What Way, Facebook is not free medium
Sergio039 [100]
"If you're not paying for it, you are the product."
Your information and (buzzword warning) "big data" are being collected and potentially sold in ways that you cannot control.
4 0
3 years ago
Other questions:
  • While moving into a new apartment, Titus needed to hold the door open with something heavy. It suddenly dawned on him that he co
    9·1 answer
  • Davia draws a shape with 5 sides. two sides are each 5 inches long. two other sides are each 4 inches long. the perimeter of the
    15·1 answer
  • video-sharing sotes such as youtube and vimeo provide a place to post short videos called clips true or false?
    5·1 answer
  • write a program that reads in the length and the width of a rectangular yard . your program should compute the time required ( i
    5·1 answer
  • Which of the following illustrations is depicted in the icon that's used to access Windows Help and Support files?
    13·1 answer
  • The signature of a function is determined by
    5·1 answer
  • What is your favourite video game??​
    5·2 answers
  • The building blocks of coded language are called
    11·2 answers
  • Select the correct answer from each drop-down menu.
    14·1 answer
  • Will this solution really fix the problem?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!