Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Area of Circle in C#

The formula for finding the area of a circle is 3.14*r*r.

r- radius, 3.14 - Pi value

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace ForgetCode
  6. {
  7. class Program
  8. {
  9. static void Main(string[] args)
  10. {
  11. int r;
  12. double A;
  13. Console.WriteLine("Enter the radius:");
  14. r = Convert.ToInt32(Console.ReadLine());
  15. A = (3.14) * r * r;
  16. Console.WriteLine("The Area of circle of given radius is=" + A);
  17. Console.ReadLine();
  18. }
  19. }
  20. }