Example: Calculating Triangle Area

Create a method that calculates the area of a triangle using the given base and heigth and returns it as a result.

Sample Input and Output

Input Output
3
4
6

Hints and Guidelines

The first step is to read the input. After this create a method, but this time be careful when declaring to give it the correct type of data, we want the method to return, which is double.

The next step is to invoke the new method from the Main() method and to write down the return value in a suitable variable.

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/594#4.

results matching ""

    No results matching ""