Search an Element in an Array in C#

Hi Guy’s,here is the article to Search an Element in an Array in c# console application. Inside the program , i have taken four integer variables and one array type variable.
First for loop that i used to store elements inside the array. second for loop to filter the maximum array limits.if searching elements match with array index elements then flag become
1 and write method print number with position.After printing break statements i used to terminate
the loop. suppose if no elements match then flag value remain negative and print “Number not found in the array. Let’s see the program.

Input and Output Screen

To Print multiple searching position of an array. Comment on Break statement.

Happy programming…Thanks.

Post Author: adama