Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. clear
  2. clc
  3.  
  4. A = input("Entre com o valor de A ")
  5. while A==0
  6. printf("Valor Inválido")
  7. A = input("Entre com o valor de A ")
  8. end
  9.  
  10. b = input("Entre com o valor de B ")
  11. c = input("Entre com o valor de C ")
  12.  
  13. d = b^2 - (4*A*c)
  14.  
  15. if d == 0 then
  16.  
  17. x = (-b + sqrt(d))/(2*A)
  18. disp(x)
  19.  
  20. end
  21.  
  22. else if d < 0 then
  23.  
  24. printf("sem raizes no campo dos reais")
  25. end
  26.  
  27. else
  28.  
  29. x1 = (-b + sqrt(d))/(2*A)
  30. x1 = (-b - sqrt(d))/(2*A)
  31. disp(x1)
  32. disp(x2)
  33. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement