Why? I still cant code the area of circle | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why? I still cant code the area of circle

the number 12 project on c# is hard. I already tried alots of way. I really cant. Here's my last coding for it 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; //your code goes here radius = Console.ToDouble(Console.Readline()); double n = pi * (radius * radius); Console.Writeline(n); } } }

25th Sep 2021, 4:43 AM
arm kelli
arm kelli - avatar
1 Answer
+ 6
Notice carefully the last 3 lines of the snippet: 1. Convert.ToDouble not Console.ToDouble 2. Console.ReadLine not Console.Readline (uppercase L) radius = Convert.ToDouble(Console.ReadLine()); 3. Console.WriteLine not Console.Writeline(uppercase L) Console.WriteLine(n);
25th Sep 2021, 5:08 AM
Ipang