Question
WRITE A SIMPLE BUT A COMPLETE FORTRAN PROGRAM TO CALCULATE THE AREA OF A TRIANGLE
Answers
Indicate your specific subject in the "School Subject" box, so those with expertise in the area will respond to the question.
Second, please do not use all capitals. Online it is like SHOUTING. Not only is it rude, but it is harder to understand. Thank you.
Second, please do not use all capitals. Online it is like SHOUTING. Not only is it rude, but it is harder to understand. Thank you.
It would be something like this:
WRITE(6,*)'INPUT Base and Height='
READ(5,*)B,H
AREA=B*H/2.0
WRITE(6,*)'AREA OF TRIANGLE IS ',AREA
STOP
END
Most (old) compilers would require the first 6 characters to be blank in the above program.
STOP is for execution time termination.
END is for compiler to know that this is the end of the subroutine, function or main program.
You can do the other program(s) in a similar way.
WRITE(6,*)'INPUT Base and Height='
READ(5,*)B,H
AREA=B*H/2.0
WRITE(6,*)'AREA OF TRIANGLE IS ',AREA
STOP
END
Most (old) compilers would require the first 6 characters to be blank in the above program.
STOP is for execution time termination.
END is for compiler to know that this is the end of the subroutine, function or main program.
You can do the other program(s) in a similar way.
@psydag, sorry for shouting
@mathmate, thanks for the solution
thank you
edwin
@mathmate, thanks for the solution
thank you
edwin
Related Questions
Pls I need a simple access control program written in either basic or fortran programming language.
WRITE A SIMPLE BUT A COMPLETE FORTRAN PROGRAM TO COMPUTE THE AVERAGE OF SIX NUMBERS AND DISPLAY THE...
1. WRITE A PROGRAM TO CALCULATRE THE AREA OF A RECTANGLE OF LENGTH =5 CM AND BREADTH=8CM.
2. CALCUL...
Write a Fortran program that will calculate the sum and average of 9 number.