Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 1.13 KB

README.md

File metadata and controls

45 lines (29 loc) · 1.13 KB

Quadratic Formula

The Quadratic Formula solves the quadratic equation for x. This training project, prepared by Codecademy.

Table of Contents

Project Prompt

In algebra, a quadratic equation is an equation having the form:

ax2 + bx + c = 0

Graphing, we get the curve below:

Graph

The corresponding x values are the x-intercepts of the graph, while a, b, and c are constants.

Write a C++ program called quadratic.cpp that solves the quadratic equation for the x‘s:

Quadratic formula

Technologies

  • C++

Setup

How to compile and execute:

  1. Download quadratic.cpp.
  2. Open the terminal or command line and navigate to the directory where the downloaded file resides.
  3. Run the following commands to compile and execute the program:
g++ quadratic.cpp -o quadratic
./quadratic

Sources

Codecademy's Learn C++ Course