Answer the question
In order to leave comments, you need to log in
How to count the percentage of elements in a list with LINQ?
Tell me how you can calculate the percentage using LINQ and display its result?
There is a list of values, it can be different in number. It is necessary to display, for example, 30 percent of this list, that is, [9,8,7] (33%). Rounding up.
public void Start()
{
var list = new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
list.Top(30)
}
public void Top(int list)
{
IEnumerable<int> topPercent = ;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question