generate range c#
// Generate a sequence of integers from 1 to 10
// and then select their squares.
IEnumerable<int> squares = Enumerable.Range(1, 10).Select(x => x * x);
foreach (int num in squares)
{
Console.WriteLine(num);
}
/*
This code produces the following output:
1
4
9
16
25
36
49
64
81
100
*/
Also in C#:
- c# capitalize first letter
- unity create a child object
- c# display float with 2 decimal places
- c# skip following code in loop
- create new object from generic c#
- webutility.urlencode space
- c# xml file builder
- how to store some variables on the device in unity
- get web config key value in c# razor view
- jumping with character controller unity
- C# .net core convert to int round up
- c# fileupload example
- scaffold-dbcontext sql server
- loop over enum values
- find negative version of integer in c#
- c# write to console
- how to find the area of a circle
- variables
- c# remove from list in foreach
- panel drag all form c#
- parse strings into words C#
- c# max sequence contains no elements
- unity custom editor save changes
- c# append array