Coders Packet

Quadratic Equations Roots using C++ program

By Akanksha Sharma

Quadratic equations are in the form- a(x*x) + b(x) + c =0. Finding the value of x which satisfies the equation are called roots. Let's find them using C++ program.

What are Quadratic Equations?

Quadratic equations are in the form:- a(x*x) + b(x) + c =0. Finding the value of x which satisfies the equation are called solutions for given quadratic equations or roots of the given equation.

The formula for calculating the roots manually is:- Roots of Quadratic eq

How to use code:-

The code file is attached you can copy the code and paste it into your preferred IDE. Our suggestion will be to use VS Code.

How code is made:-

Firstly, the code will take input for values of a, b and c respectively. Then, it will check if the given equation is valid or not. If the equation is valid it will find the roots and print them else will show "It is not a valid equation." OR "It does not have real roots."

Download project

Reviews Report

Submitted by Akanksha Sharma (Akanksha)

Download packets of source code on Coders Packet