- 1

Array

Question ---------- Array Methods What is the output of this code? int[ ] a = {4, 6, 5, 2}; int x = a[0]+a.Min(); Console.Write(x); ------------ Answers : 6 ------------ code with cshap ---------------- using System; using System.Linq; namespace MyApplication { class Program { static void Main(string[] args) { int[] a = {5, 1, 8, 9}; int x = a[0]+a.Min(); Console.WriteLine(x); } } }

26th Sep 2021, 4:22 AM
YOUN Tit
YOUN Tit - avatar
2 Réponses
+ 2
YOUN Tit Min method returns min value of array so a[0] = 5 and min value is 1 so result is 6
26th Sep 2021, 4:47 AM
A͢J
A͢J - avatar
+ 1
Please post in Code playground, not here.
26th Sep 2021, 4:47 AM
Rupali Haldiya
Rupali Haldiya - avatar