CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
PRINT "Area of triangle is : "; a
END
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
PRINT "Area of triangle is : "; a
END
Area of triangle when 3 sides are given using SUB Procedure
DECLARE SUB area(x,y,z)
CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
CALL area(x, y, z)
END
SUB area (x, y, z)
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
PRINT "Area of triangle is : "; a
END SUB
CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
CALL area(x, y, z)
END
SUB area (x, y, z)
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
PRINT "Area of triangle is : "; a
END SUB
Area of triangle when 3 sides are given using FUNCTION Procedure
DECLARE FUNCTION area(x,y,z)
CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
a = area(x, y, z)
PRINT "Area of triangle is : "; a
END
FUNCTION area (x, y, z)
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
area = a
END FUNCTION
CLS
INPUT "Enter the value of first side : "; x
INPUT "Enter the value of second side : "; y
INPUT "Enter the value of third side : "; z
a = area(x, y, z)
PRINT "Area of triangle is : "; a
END
FUNCTION area (x, y, z)
s = (x + y + z) / 2
a = (s * (s - a) * (s - b) * (s - c)) ^ (1 / 2)
area = a
END FUNCTION
No comments:
Post a Comment
If you have any doubts, Please let me know.