Will Web 3.0 Replace Web 2.0?
Become a member
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
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Jon Smit
2.2k
6
1.5k
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?