The program asks the user to input values for a, b, and c. It then implements a function called quad that takes in those values plus two additional variables to store the square roots. The quad function calculates the discriminant and returns the number of roots, storing any roots in the additional variables. It prints statements with the appropriate roots depending on if the discriminant is positive, zero, or negative.