Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear
- clc
- A = input("Entre com o valor de A ")
- while A==0
- printf("Valor Inválido")
- A = input("Entre com o valor de A ")
- end
- b = input("Entre com o valor de B ")
- c = input("Entre com o valor de C ")
- d = b^2 - (4*A*c)
- if d == 0 then
- x = (-b + sqrt(d))/(2*A)
- disp(x)
- end
- else if d < 0 then
- printf("sem raizes no campo dos reais")
- end
- else
- x1 = (-b + sqrt(d))/(2*A)
- x1 = (-b - sqrt(d))/(2*A)
- disp(x1)
- disp(x2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement