I have written the following program:Program distanceImplicit NONEReal :: x1, x2, y1, y2write(*,*) "Enter the x coordinate of your fisrt point:"read(*,*) x1write(*,*) "Enter the y coordinate of your first point:"read(*,*) y1write(*,*) "Enter the x coordinate of your second point:"read(*,*) x2write(*,*) "Enter the y coordinate of your second point:"read(*,*) y2write(*,*) SQRT((x2-x1)^2 + (y2-y1)^2)end program distanceWhen i try to compile it i get this error message:write(*,*) SQRT((x2-x1)^2 + (y2-y1)^2)1Error: Syntax error in argument list at (1)Can anyone tell me what is wrong with this?
9/14/2009 1:29:35 PM
9/14/2009 1:39:54 PM
^ should be **
9/14/2009 1:45:55 PM
Fortran doesn't take ^ for exponentiation, you have to use **.I realized, after clicking "reply to topic" that sarijoul was telling you this, and not adding to qntmfred's mockery of you.lolz and apologies to sarijoul, gg[Edited on September 14, 2009 at 6:25 PM. Reason : ]
9/14/2009 6:24:57 PM