Computer Science, asked by chaohan2271, 1 year ago

given an unsorted array of n elements find if the element k is present in the array or not program in c

Answers

Answered by Ayushjisingh
0
an unsorted array=k and c

Ayushjisingh: accha lage to brainlist karna
Answered by phillipinestest
0

class find{

public static void main(String[] args){

char[]  cvalue = {'a', 'x', 'k', 'l', 'm', 'p', 'i', 'o', 'y', 'h', 'j', 'b', 'g', 'f', 't', 'r'};

char  toFind = 'k';

boolean helpfind = Arrays.stream(cvalue).anyMatch ( t-> t.equals (tofind));

if(helpfind)

System.out.println( tofind + "is found" );

else

System.out.println(tofind + "is not found");

}

}

This is the program that can be used the get the drsied output: To arrange the unsorted array of elements by giving a value to k, which is the variable here.

Similar questions