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
John Q
NA
12
44.3k
C# Returning multiple values
Jan 24 2014 10:48 AM
I've the following code and it seems to work but how do I make it so that when the recursive is finished, it return more than one variable? Right now it's only return one value, how do I change the sub below to return more than one value like an integer and a string. Thanks in advance.
using System;
class Program
{
static int Recursive(int value, ref int count)
{
count++;
if (value >= 10)
{
// throw new Exception("End");
return value;
}
return Recursive(value + 1, ref count);
}
static void Main()
{
int count = 0;
int total = Recursive(5, ref count);
Console.WriteLine(total);
Console.WriteLine(count);
}
}
Reply
Answers (
1
)
This is regarding of MDI Forms
i help me