Compute the area of a circle in CSharp

Description

The following code shows how to compute the area of a circle.

Example


using System;  //ww w  .  j a v a  2s  .  com
   
public class ComputeCircle {   
  static void Main() {   
    double radius; 
    double area; 
 
    radius = 1123.0; 
    area = radius * radius * 3.1416; 
 
    Console.WriteLine("Area is " + area); 
  }   
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var