Write a function named triArea() that takes two parameters for base and height of a triangle, calculates
Fantastic news! We've Found the answer you've been seeking!
Question:
Write a function named triArea() that takes two parameters for base and height of a triangle, calculates the area and returns it. (Hint: The base of a triangle is calculated as base * height/2)
Prompt the user to enter base and height of 10 different triangles. Every time the user enters the pair of values, you should call the triArea() function, pass the arguments to function and print the returned result on the screen. (Hint: Use a loop to get values for 10 different triangles from the user)
Related Book For
Posted Date: