To find the surface area of a triangular prism, we need to find the areas of each face and then add them up.
Here's the code in C#:
main.cs667 chars26 lines
In the above code, we first input the dimensions of the triangular prism. We then calculate the area of each face using the appropriate formulae. Finally, we add all the areas together to get the surface area of the prism, which we display using Console.WriteLine()
.
gistlibby LogSnag