VelizarAvramov

02. Circle Area (Precision 12)

Nov 5th, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _02._Circle_Area__Precision_12_
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Write program to enter a radius r (real number) and print the area of the circle with exactly 12 digits after the decimal
  10.             //point. Use data type of enough precision to hold the results.
  11.             double radius = double.Parse(Console.ReadLine());
  12.             double area = Math.PI * Math.Pow(radius, 2);
  13.             Console.WriteLine($"{area:f12}");
  14.         }
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment