Q. How to multiply by 10 , each element of an integer Array by using LINQ ?
Ashvani chaudhary
int[] number = { 1, 2, 3, 4, 5 };var result = number.Select(n => n * 10);foreach (var item in result){Console.WriteLine(item);}
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();}}
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();}}