Below code helps us to get element in array is multiple of 3 or not if it is value return is true else false
static void Main(string[] args)
{
//below is the array contains elements
int[] arrayno = { 12, 33, 24, 90, 99, 42, 75 };
bool CheckMultiple = CheckElement(arrayno, 3);
}
//function which return either true or false
private static bool CheckElement(int[] arrayno, int divisor)
{
bool CheckMultiple = arrayno.All(number => number % divisor == 0);
return CheckMultiple;
} | |