jueves, 8 de octubre de 2020

SEGUNDO_GRADO.PY

 #jessica ponce

from math import  sqrt
print("programa para resolver ecuaciones de 2do grado:")
print("ax^2 + bx + c")

a=float(input("ingrese el valor de a:"))
b= float(input("imgrese el valor de b:"))
c= float(input("ingrese el valor de c:"))

if a!=0:
x1=( - b + sqrt((b**2)- 4 * a * c))/(2* a)
x2=( - b - sqrt((b**2)- 4 * a * c))/(2* a)
print("soluciones: x1= {0:3f} y x2={1:3f}".format(x1,x2))
elif a == 0:
print("no tiene solucion")
input()
PANTALLA DE SALDA


 




No hay comentarios:

Publicar un comentario