How to find value in an int array with C#

1 Answer

0 votes
using System;
using System.Linq;

public class Program
{
	public static void Main(string[] args)
	{
		int[] array = new int[] {2, 3, 6, 5, 30, 0};
        
		Console.WriteLine(array.Contains(5));
		Console.WriteLine(array.Contains(7));
	}
}




/*
run:
   
True
False
   
*/

 



answered Jul 23, 2023 by avibootz

Related questions

1 answer 160 views
1 answer 129 views
1 answer 165 views
1 answer 151 views
2 answers 141 views
...