first commit
This commit is contained in:
25
listas3/source/exercicios8.cs
Normal file
25
listas3/source/exercicios8.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
|
||||
namespace exercicios
|
||||
{
|
||||
class Exercicio8
|
||||
{
|
||||
public static void Init()
|
||||
{
|
||||
float b,a;
|
||||
Console.WriteLine("Hypotenuse Calculator\nInsert the values for b (triangle base) & a (triangle height).");
|
||||
|
||||
b = float.Parse(Console.ReadLine());
|
||||
a = float.Parse(Console.ReadLine());
|
||||
|
||||
Console.WriteLine("\nTriangle base {0}, Height {1}, Hypotenuse {2:N2}",
|
||||
b,
|
||||
a,
|
||||
hipotenusa(a,b));
|
||||
}
|
||||
static float hipotenusa(float b, float a)
|
||||
{
|
||||
return (float)Math.Sqrt((b*b)+(a*a));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user