Skip to content

This Rust program accepts command-line arguments and functions as a quadratic equation solver, akin to the 'Almighty Formula.' It can solve any quadratic equation of the form ax^2 + bx + c = 0, provided that you correctly pass the expected arguments.

Notifications You must be signed in to change notification settings

Hossanadev/quadratic-equation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This Rust program accepts command-line arguments and functions as a quadratic equation solver, akin to the 'Almighty Formula.' It can solve any quadratic equation of the form ax^2 + bx + c = 0, provided that you correctly pass the expected arguments.

This solution is written in Rust programming by Hossanadev.

How it works:

The program makes use of command line arguments (args).

  • It accepts 3 args, a, b, and c respectively.

  • To run this program, install rust.

  • Open this file, run this command: Example: assuming a is 1, b is 4 and c is 1; you run: cargo run 1 4 1 then you'll see the result.

    Note: If the value of the discriminant is less than 0.0, you'll see No real roots exist. as a response.

    If the length of agrs passed is less than or greater than 3, example: cargo run 1.0 3.8 or cargo run 1.0 2.0 3.0 4.0 you'll get an error as response!

About

This Rust program accepts command-line arguments and functions as a quadratic equation solver, akin to the 'Almighty Formula.' It can solve any quadratic equation of the form ax^2 + bx + c = 0, provided that you correctly pass the expected arguments.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages