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
Jon Smit
NA
6
2k
passing parameters with out
Dec 17 2018 7:15 AM
write the method GetModeAverage, which takes an array of integers as a parameter, and another integer as out parameter.
Assign the Mode average to the out integer parameter. The Mode average is the number that appears most frequently.
using System;
namespace HelloWorld
{
class Program
{
private static void GetModeAverage(int[] numbers, out int mode)
{
Array.OrderByDescending(numbers);
mode = numbers[0];
}
static void Main(string[] args)
{
int mode;
int[] numbers = { 1, 2, 3, 3, 4, 5, 5, 5, 6, 7, 8, 8 };
GetModeAverage(numbers, out mode);
Console.WriteLine(mode);
}
}
}
Reply
Answers (
3
)
Gridview and dropdown list and buttons Hiding
do- while loop help?