SEGUNDO_GRAU
Fortran
program SEGUNDO_GRAU
Implicit none
!Bloco de Variáveis
Integer(4):: a,b,c
Real(8):: x1, x2, delta
!.................
! Leitura dos dados
read(*,*)a
read (*,*)b
read (*,*)c
! Impressão dos dados
write(*,*) a,b,c
if (a/=0) then
delta = b**2.0-4.0*a*c
! Cálculo das raízes
x1 = (-b + (delta) ** 0.5) / (2.0*a)
x2 = (-b - (delta) ** 0.5) / (2.0*a)
if (delta>0) then
write(*,*) "EXISTE DUAS RAÍZES REAIS E DISTINTAS"
write (*,*) x1, x2
! Impressão dos resultados
write (*,*) x1, x2
else
write (*,*) "COEFICIENTE a=0"
end if
end program
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.