answersLogoWhite

0

implicit double precision(a-h,o-z)

write(*,*) "please provide the a,b,c coeff"

read(*,*) A,B,C

D=B*B-4*A*C

if(D.GT.0) then

root1=(-B/(2*A))+(SQRT(D))/(2*A)

root2=(-B/(2*A))-(SQRT(D))/(2*A)

write(*,*) root1,root2

elseif(D.EQ.0) then

root1=(-B/(2*A))

root2=root1

write(*,*) root1,root2

else

root1=(-B/(2*A))+(SQRT(-D))/(2*A)

root2=(-B/(2*A))-(SQRT(-D))/(2*A)

a=(root1+root2)/2

b=(root1-root2)/2

write(*,*) 'realpartroot=',a, 'complexpartroot=',b

endif

stop

END

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Write an algorithm and draw a flowchart that will calculate the roots of quadratic equation?

dejene


Write an algorithm to find the root of quadratic equation?

Write an algorithm to find the root of quadratic equation


How did you write each quadratic equation in standard form?

readuse the answer


How do you write a poem on the roots of the quadratic equation?

2000X=Y2KoverZzz?


How can you write a complete fortran program to calculate a simple interest siprt100 given principal rate and time?

Solve simple intress usin fortran


Can you write an equation that includes the keyword "quadratic"?

An example of a quadratic equation is ( ax2 bx c 0 ), where ( a ), ( b ), and ( c ) are constants and ( x ) is the variable.


How do you write a quadratic equation in standard form?

ax2 + bx + c


How do you write a pseudo code for find the quadratic equation?

computer scince


How would you go about solving a quadratic equation?

Write the quadratic equation in the form ax2 + bx + c = 0 then the roots (solutions) of the equation are: [-b ± √(b2 - 4*a*c)]/(2*a)


When the roots are equal of a quadratic equation?

Write the quadratic equation in the form ax2 + bx + c = 0 The roots are equal if and only if b2 - 4ac = 0. The expression, b2-4ac is called the [quadratic] discriminant.


Is write a FORTRAN command?

Yes. The FORTRAN write command output's data to a file.


What are all the ways you can solve a quadratic equation?

First, write the equation in standard form, i.e., put zero on the right. Then, depending on the case, you may have the following options:Factor the polynomialComplete the squareUse the quadratic formula