TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Eric Kraus
NA
9
569
Area of a circle, with default integer value
Mar 9 2020 1:20 PM
static
void
Main(
string
[] args)
{
WriteLine(
"What is the radius of your circle: "
);
WriteLine(
"The area of your circle is: "
+ circleArea(Double.Parse(ReadLine())).ToString());
ReadKey();
}
static
double
circleArea(
double
radius = 5.00)
{
return
Math.PI * (radius * radius);
}
So far the code I have is working and it is able to calculate the area of a circle; however, I need to have the main method pass an integer variable (radius) with an optional default value. I thought I had it by adding =5 to my second method, but that wasn't it.
Any help would be appreciated.
Reply
Answers (
3
)
Pagination without using jquery
Gridview GrandTotal On Top of Gridview .?