Pure Programmer
Blue Matrix


Cluster Map

Project: Quadratic Roots

Quadratic equations of the form Ax2 + Bx + C = 0 have two possible solutions given by the [[Quadratic Formula]]. Write a program that sets the constants A = 2, B = 4 and C = 1 then prints the two possible solutions. Then change the constants A, B and C to get solutions to other quadratic equations. Is it possible that this program could fail?

Output
$ swiftc QuadraticRoots.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution