Advertisement
kuruku

CirclePerimetarAndArea

Apr 19th, 2014
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1. using System;
  2.  
  3. //Write a program that reads the radius r of a circle and prints its perimeter and area formatted with 2 digits after the decimal point.
  4. Examples:
  5. //r         perimeter   area
  6. //2         12.57       12.57
  7. //3.5       21.99           38.48
  8.  
  9. class CirclePerimetarAndArea
  10. {
  11.     static void Main(string[] args)
  12.     {
  13.         double r = double.Parse(Console.ReadLine());
  14.         Console.WriteLine("Perimetur = {0:F2}" , 2*r*3.14);
  15.         Console.WriteLine("Area = {0:F2}", r * r * 3.14);
  16.  
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement