The compiler infers the type of the range variable when the data source implements IEnumerable. For example, if the source has a type of IEnumerable<Customer>, then the range variable is inferred to be Customer. The only time that you must specify the type explicitly is when the source is a non-generic IEnumerable type such as ArrayList. For more information, see How to: Query an ArrayList with LINQ.
In the previous example num is inferred to be of type int. Because the range variable is strongly typed, you can call methods on it or use it in other operations. For example, instead of writing select num, you could write select num.ToString() to cause the query expression to return a sequence of strings instead of integers. Or you could write select n + 10 to cause the expression to return the sequence 14, 11, 13, 12, 10. For more information, see select clause (C# Reference).
The range variable is like an iteration variable in a foreach statement except for one very important difference: a range variable never actually stores data from the source. It just a syntactic convenience that enables the query to describe what will occur when the query is executed. For more information, see Introduction to LINQ Queries.