포트란, 사다리꼴의 넓이 공식, trapezoid_area_formula
Channel: Fortran Tutorial
Date: 2022-02-18

#포트란 #사다리꼴의 넓이 공식 #trapezoid_area_formula
      program trapezoid_area_formula
      real low,top, height, area
      write(*,*) 'input low'
      read(*,100) low 
100   format(f6.2)
      write(*,*) 'input top'
      read(*,101) top 
101   format(f6.2) 
      write(*,*) 'input height'
      read(*,102) height 
102   format(f6.2)

      area=(low+top)*height/2.0
      write(*,*) '    low     top  height    area'      
      write(*,200) low,top,height,area
200   format(4f8.2)
      endprogram trapezoid_area_formula