Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class IndexOfGivenElement
- {
- static void Main()
- {
- int[] arr = new int[5] {11 , 15, 17, 20, 29};
- int elIndex = 29;
- int count = 0;
- for (int i = 0; i < arr.Length; i++)
- {
- count++;
- if (arr[i] == elIndex)
- {
- Console.WriteLine("The number [{0}] is in position {1}", elIndex, i);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement