C Program to calculate the area of triangle
write(*,*)'Enter the sides of the triangle:'
read(*,*)a,b,c
s=(a+b+c)/2.0
z=sqrt(s*(s-a)*(s-b)*(s-c))
write(*,10)z
10 format(2x,'The area of the triangle is',f16.4)
end
write(*,*)'Enter the sides of the triangle:'
read(*,*)a,b,c
s=(a+b+c)/2.0
z=sqrt(s*(s-a)*(s-b)*(s-c))
write(*,10)z
10 format(2x,'The area of the triangle is',f16.4)
end
Comments
Post a Comment