Answer to Question #176923 in C# for Daisy

Question #176923

Write a c sharp program that computes the circumstance and area of a circle. Declare pi as constant with value of 3.1416.


1
Expert's answer
2021-03-30T12:08:57-0400
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace Q176923
{
    class Program
    {
        static void Main(string[] args)
        {
            //Declare pi as constant with value of 3.1416.
            double PI = 3.1416;
            double radius;
            //read radius
            Console.Write("Enter radius: ");
            radius = double.Parse(Console.ReadLine());
            // compute the circumstance and area of a circle.
            double circumstance=2*radius*PI;
            double area=radius*radius*PI;
            // Display the circumstance and area of a circle.
            Console.WriteLine("The circumstance of circle: {0}",circumstance);
            Console.WriteLine("The area of circle: {0}",area);
            Console.ReadLine();
        }
    }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS