+ 4
Can anyone tell me whats wrong in my code to find the area of the circle in C#(End of Module project)
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; double area; //your code goes here Console.Writeline ("Enter the radius of the circle"); radius = Convert.Todouble(Console.Readline()); area = pi * radius * radius; Console .Writeline("Area of the circle is {0} of {1}",area, radius ); } } }
7 odpowiedzi
+ 3
Try this
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)
{
double pi = 3.14;
double diameter =Convert.ToDouble(Console.ReadLine());
Console.WriteLine(pi*diameter*diameter);
}
}
}
+ 6
But it said there is no such function named console.writeline
+ 5
Thanks a lot.
+ 4
Now it is saying that convert does not contain to double function
+ 2
Console.WriteLine();
Is this what you are saying.
+ 1
Alice Petey Just return the area of the circle don't put anything else. And delete the "Enter the radius of the circle part". Then it'll be okay
If you don't understand please check out this code.
https://code.sololearn.com/cyUPm2my7GBR/?ref=app