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
5 Antworten
+ 2
radius =Convert.ToDouble(Console.ReadLine());
+ 1
thanks
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
}
}
}
0
there are test cases using 5 ,6.4,10
0
ok I'll try that