CS 1401 Introduction to Computer Science
Fall 2014, Lab 3

Assignment. Write a program that prompts the user to input three real numbers and prints these numbers in non-decreasing order.

Hint: you need to consider all possible orders between the three numbers x1, x2, and x3. We separately consider cases when x1 is the largest, when x2 is the largest, and when x3 is the largest:

For extra credit: write a program that computes the roots of a quadratic equation a * x2 + b * x + c = 0; formulas are given, e.g., in Problem 3.1. Please note that we are only interested in real solutions; for example, for the equation x2 + 1 = 0, your program should return a message that this equation does not have any solutions.

When it is due. The program is due at the beginning of the first lab section on the week of September 22, i.e.: