Answers for "quadratic equations examples"

C
2

quadratic equation

(-b-sqrt(b**2-4*a*c))/(2*a)
(-b+sqrt(b**2-4*a*c))/(2*a)
If that doesn't work,
((0-b)-sqrt(b**2-4*a*c))/(2*a)
((0-b)+sqrt(b**2-4*a*c))/(2*a)
Posted by: Guest on December-31-2021
1

quadratic equation

Δ=b2−4ac 
(-b±√Δ)/2a
Posted by: Guest on January-30-2022
0

Quadratic Equation

import tkinter as tk
import cmath

root= tk.Tk()

root.title("Quadratic Solver")

canvas1 = tk.Canvas(root, width = 400, height = 300)
canvas1.pack()

entry1 = tk.Entry (root) 
canvas1.create_window(200, 60, window=entry1)

entry2 = tk.Entry (root) 
canvas1.create_window(200, 100, window=entry2)

entry3 = tk.Entry (root) 
canvas1.create_window(200, 140, window=entry3)


def solvequadratic ():
    a = int(entry1.get())
    b = int(entry2.get())
    c = int(entry3.get())

    label1 = tk.Label(root, text= ((-b-cmath.sqrt((b**2)-(4*a*c))/(2*a))))
    canvas1.create_window(200, 230, window=label1)
    label1 = tk.Label(root, text = ((-b+cmath.sqrt((b**2)-(4*a*c))/(2*a))))
    canvas1.create_window(200, 260, window=label1)
    
button1 = tk.Button(text='Solve Quadratic', command=solvequadratic)
canvas1.create_window(200, 180, window=button1)

root.mainloop()
Posted by: Guest on February-21-2022

Code answers related to "C"

Browse Popular Code Answers by Language