Last active
November 21, 2024 17:18
-
-
Save BluePyTheDeer251/b3ba6314f5e6b6606660dc852849e419 to your computer and use it in GitHub Desktop.
A C# program that will calculate the area of a triangle. (written with top-level functions)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("Please input the number of the base of the triangle. "); | |
int triangleBase = Convert.toInt32(Console.ReadLine()); | |
Console.WriteLine("Please input the number of the height of the triangle. "); | |
int triangleHeight = Convert.toInt32(Console.ReadLine()); | |
Console.WriteLine("Joining..."); | |
int result = triangleBase * triangleHeight / 2; | |
Console.WriteLine($"Done! Your result: {result}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment