FORTRAN 77 Program to find the root of Quadratic - TopicsExpress



          

FORTRAN 77 Program to find the root of Quadratic Equation: ======================================= 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
Posted on: Sat, 08 Mar 2014 04:43:49 +0000

Trending Topics



Recently Viewed Topics




© 2015