Guys I am having a problem finishing this code project.I am having trouble in finishing its all 3 test samples. Help me guys | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Guys I am having a problem finishing this code project.I am having trouble in finishing its all 3 test samples. Help me guys

We are going to write a program that will calculate the area of ​​a circle. The area enclosed by a circle of radius r is πr², where π (pi) is the constant ratio of the circumference of any circle to its diameter, and r is the radius. The given program declares a constant pi variable with a value of 3.14. Complete the program to take the radius as input, then calculate and output the area of the circle. Sample Input 5 Sample Output 78.5

26th Feb 2022, 8:15 AM
Shisham Shrestha
5 Answers
+ 2
radius =Convert.ToDouble(Console.ReadLine());
26th Feb 2022, 4:16 PM
Simba
Simba - avatar
+ 1
thanks
26th Feb 2022, 4:30 PM
Shisham Shrestha
0
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { const double pi = 3.14; double radius; radius =Convert.ToDouble(5); double area; area =pi*radius*radius; Console.WriteLine(area); //your code goes here } } }
26th Feb 2022, 1:57 PM
Shisham Shrestha
0
there are test cases using 5 ,6.4,10
26th Feb 2022, 1:59 PM
Shisham Shrestha
0
ok I'll try that
26th Feb 2022, 4:30 PM
Shisham Shrestha