Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void Main(string[] args) {
- float PI = 3.14f;
- float r;
- Console.Write("Put 1 to Calcuate the Length of the Circle \n");
- Console.Write("Put 2 to Calcuate the Area of the Circle \n");
- Console.Write("you put :");
- string x = Console.ReadLine();
- switch (x) {
- case "1":
- Console.Write("put radius:");
- r = int.Parse(Console.ReadLine());
- float L = (float)2 * PI * r;
- Console.Write("Lenght of circle is :{0:f}\n", L);
- break;
- case "2":
- Console.Write("put radius:");
- r = int.Parse(Console.ReadLine());
- float A = (float)PI * (r * r);
- Console.Write("Area of circle is : {0}\n", A);
- break;
- default:
- Console.Write("Error\n");
- break;
- }
- Console.Write("Press any key to continue");
- Console.ReadKey();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement