7
Reply

C# foreach loop program

Micheal John

Micheal John

Jun 9 2015 8:31 AM
674
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)