Choose your desired operation
[CIRCUMFERANCE OF A CIRCLE]
[PERIMITER OF A TRIANGLE]
using System;
namespace App
{
class Program
{
static void Main(string[] args)
{
int operation = -1;
while (operation != 3)
{
Console.WriteLine("1. CIRCUMFERANCE OF A CIRCLE");
Console.WriteLine("2. PERIMITER OF A TRIANGLE");
Console.WriteLine("3. EXIT");
Console.Write("Choose your operation: ");
operation = int.Parse(Console.ReadLine());
if (operation == 1)
{
Console.WriteLine("Enter a radius of a circle: ");
double radius = double.Parse(Console.ReadLine());
double circumferenceCircle = 2 * Math.PI * radius;
Console.WriteLine("Circumference of a circle : {0}", circumferenceCircle);
}
else if (operation == 2)
{
Console.WriteLine("Enter a side 1 of a triangle: ");
double side1 = double.Parse(Console.ReadLine());
Console.WriteLine("Enter a side 2 of a triangle: ");
double side2 = double.Parse(Console.ReadLine());
Console.WriteLine("Enter a side 3 of a triangle: ");
double side3 = double.Parse(Console.ReadLine());
double perimiter = side1 + side2 + side3;
Console.WriteLine("Perimiter of a triangle : {0}", perimiter);
}
}
}
}
}
Comments
Leave a comment