using
System;
namespace
range_example {
class
GFG {
static
void
Main(
string
[] args)
{
string
[] arr =
new
string
[8] {
"Archery"
,
"Badminton"
,
"Cricket"
,
"Bowling"
,
"Boxing"
,
"Curling"
,
"Tennis"
,
"Skateboarding"
};
var
r1 =
new
Range(0, 3);
var
r2 =
new
Range(4, 7);
var
res1 = r1.End;
var
res2 = r2.End;
Console.WriteLine(
"End Index of Range {0} is {1}"
+
" and the item is {2}"
, r1, res1, arr[res1]);
Console.WriteLine(
"End Index of Range {0} is {1} and"
+
" the item is {2}"
, r2, res2, arr[res2]);
}
}
}