Pls help me with this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Pls help me with this code

Area of circle (C#)

21st Dec 2022, 7:28 AM
Semilore Akinyode
17 Answers
0
Can I see your code?
21st Dec 2022, 7:36 AM
Knight
Knight - avatar
+ 2
I don't understand
21st Dec 2022, 8:24 AM
Semilore Akinyode
+ 1
Console.WriteLine(pi*radius*radius);
21st Dec 2022, 8:24 AM
Semilore Akinyode
+ 1
console.WriteLine(pi*(r**2))
21st Dec 2022, 8:28 AM
Knight
Knight - avatar
+ 1
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 Console.WriteLine(pi*(r**2)); } } }
21st Dec 2022, 9:58 AM
Semilore Akinyode
+ 1
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 = Convert.ToDouble(Console.ReadLine()); double z; z = pi * Math.Pow(radius, 2); Console.WriteLine(z); } } }
21st Dec 2022, 10:11 AM
Knight
Knight - avatar
0
Thanks
21st Dec 2022, 8:48 AM
Semilore Akinyode
0
It doesn't work
21st Dec 2022, 8:53 AM
Semilore Akinyode
0
Perhaps the problem is in another part of the code. Can I see the whole code?
21st Dec 2022, 9:46 AM
Knight
Knight - avatar
0
You didn't specify a radius value. Judging by the comment in the code, you need to specify keyboard input. And judging by the fact that the radius has a double value, it is already squared
21st Dec 2022, 10:01 AM
Knight
Knight - avatar
0
Pls help me to solve it
21st Dec 2022, 10:09 AM
Semilore Akinyode
0
Thanks 👍
21st Dec 2022, 10:18 AM
Semilore Akinyode
0
It worked,but pls explain
21st Dec 2022, 9:08 PM
Semilore Akinyode
0
Semilore Akinyode I advise you to go through the C# material again to refresh your knowledge. You can also look at the training on the Internet for more information.
21st Dec 2022, 9:19 PM
Knight
Knight - avatar
0
I mean the Math.Pow
22nd Dec 2022, 4:34 AM
Semilore Akinyode
0
The Math.pow() method returns the base raised to the power of the exponent, that is, the value of the expression base exponent. Math.pow(base, exponent) base - Degree base. exponent - The exponent to which the base is raised.
22nd Dec 2022, 7:13 AM
Knight
Knight - avatar
0
Thanks so much
23rd Dec 2022, 12:10 AM
Semilore Akinyode