Micheal John

Micheal John

  • NA
  • 27
  • 4.6k

C# foreach loop program

Jun 9 2015 8:31 AM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
int[] ints = { 0, 10, 100, 1000, 1000000 };
string i =Console.ReadLine();
int num = int.Parse(i);
foreach (int arr in i)
{
Console.WriteLine(arr);
}
}
}
}
 
Using the for each loop i want to search an element in an array please help me. Thanks in advance. 

Answers (7)