Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Ienumerable

Answer Posted / wasim akhtar

The IEnumerable interface appears throughout C# programs. It specifies that the underlying type implements the GetEnumerator method. It enables the foreach-loop to be used.
Program that uses IEnumerable<T> [C#]

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
static void Main()
{
IEnumerable<int> result = from value in Enumerable.Range(0, 2)
select value;

// Loop.
foreach (int value in result)
{
Console.WriteLine(value);
}

// We can use extension methods on IEnumerable<int>
double average = result.Average();

// Extension methods can convert IEnumerable<int>
List<int> list = result.ToList();
int[] array = result.ToArray();
}
}

Output

0
1

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between absolute expiration and sliding-time expiration?

966


What is textbox control of .net mobile? : Microsoft dot net mobile

999


What is a virtual memory? : .NET Architecture

899


Explain the five stages in a dlx pipeline? : Dot net architecture

878


what is diffrent beatween localprinter and networkprinter

1698


Differnce between managed code and unmanaged code ?

993


Which software is used for .net programming?

891


What is password attribute of the textbox control of .net mobile? : Microsoft dot net mobile

895


What are the new features of .net 2.0?

909


what are constructors and destructors?

2089


What is parallel computing?

898


State the different levels of exceptional safety?

936


Explain the purpose of cache? How is it used? : .NET Architecture

920


Define dma? : Dot net architecture

921


What is gui programming? : .NET Architecture

876