program twolines C********************************************************************** C Read in the coefficients of A, B, C and D, E, F for two lines where: C Ax + By = C C Dx + Ey = F C Determine if the lines intersect, are parallel or perpendicular C********************************************************************** real coeffA, coeffB, coeffC real coeffD, coeffE, coeffF real slope1, slope2 print *, 'Enter coefficients for line 1: ' read *, coeffA, coeffB, coeffC print *, 'Enter coefficients for line 2: ' read *, coeffD, coeffE, coeffF C-----SLOPE OF LINE IS (-A/B) slope1 = coeffA / coeffB * (-1.0) slope2 = coeffD / coeffE * (-1.0) print *, 'Slope of line 1 is ', slope1 print *, 'Slope of line 2 is ', slope2 if (slope1 .eq. slope2) then print *, 'The two lines are parallel.' else print *, 'The two lines intersect.' end if if ((slope1 * slope2) .eq. (-1.0)) then print *, 'The lines are perpendicular to each other.' end if stop end