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. }
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s