Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- class Program
- {
- static void Main(string[] args)
- {
- int[] array = { 1, 3, 5, 6, 9, 10, 12 };
- int searchNumber = 6;
- int position;
- position = Array.BinarySearch(array, searchNumber);
- if (position > 0)
- {
- Console.WriteLine(position);
- }
- else
- {
- Console.WriteLine("The array doesn't has searching number");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment