+ 1

How do I make a program to take input and tell the area of a circle in c#?

When I was learning c# I saw that in module 1 there was a coding problem. I had to take input of a radius and find the area of a circle but I cannot solve it. Can anyone help me solve it?

14th Jan 2021, 11:03 AM
Preeyansh Tibrewal
Preeyansh Tibrewal - avatar
3 Respuestas
+ 2
https://code.sololearn.com/cc4Z0M4tcm3p/?ref=app This will help you if you did not understand what I said.
14th Jan 2021, 11:37 AM
aka :)
aka :) - avatar
+ 2
You need to create a double data type variable called "area", a double data type variable called radius for the user to input and a constant with a double data type called "pi". Assign the value 3.14 to pi. Do "area = pi * radius * radius;" Console.WriteLine(area) Formula for area of a circle - Area = pi(3.14) x radius^2 (Console.ReadLine is used to take input from the user.) (Console.WriteLine prints the value of the variable.)
14th Jan 2021, 11:36 AM
aka :)
aka :) - avatar
0
14th Jan 2021, 11:41 AM
Preeyansh Tibrewal
Preeyansh Tibrewal - avatar