Ashwani Chaudhary
Q. How to multiply by 10 , each element of an integer Array by using LINQ ?
By Ashwani Chaudhary in LINQ on Oct 30 2015
  • basha Shaik
    Aug, 2017 10

    int[] number = { 1, 2, 3, 4, 5 };var result = number.Select(n => n * 10);foreach (var item in result){Console.WriteLine(item);}

    • 1
  • Ashwani Chaudhary
    Oct, 2015 30

    class Program{static void Main(string[] args){int[] mynumber = { 1,2,3,4,5,6,7,8,9,10};mynumber = mynumber.Select(b => b * 10).ToArray();for (int i = 0; i < 10; i++){Console.Write(mynumber[i]);Console.WriteLine();}Console.ReadKey();}}

    • 1
  • Parag Ghadge
    Apr, 2021 17

    int[] multiply = new int[] { 1, 2, 3, 4, 5, 6 };
    IEnumerable result = multiply.Select(n => n * 10);
    foreach (int n in result)
    {
    Console.Write(n + “; “);
    }

    • 0
  • Rajan M
    Oct, 2018 29

    void MultiplyElements(IList elements, int by) {elements.ForEach(e => e*by); }

    • 0
  • basha Shaik
    Aug, 2017 10

    int[] number = { 1, 2, 3, 4, 5 };var result = number.Select(n => n * 10);foreach (var item in result){Console.WriteLine(item);}

    • 0
  • Sumit Jambhale
    May, 2016 17

    class Program{static void Main(string[] args){int[] a = { 10,20,30,40,50 };var res = from i in a select i * 10;foreach (var r in res){Console.WriteLine(r);}Console.ReadKey();}}

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS