using
System;
namespace
example {
class
GFG {
static
void
Main(
string
[] args)
{
string
[] greetings =
new
string
[] {
"Hello"
,
"Hola"
,
"Namaste"
,
"Bonjour"
,
"Ohayo"
,
"Ahnyounghaseyo"
};
var
index_1 = Index.FromEnd(3);
var
index_2 = Index.FromEnd(1);
var
index_3 = Index.FromEnd(4);
var
index_4 = Index.FromEnd(5);
Console.WriteLine(
"Index: {0} Value: {1}"
,
index_1, greetings[index_1]);
Console.WriteLine(
"Index: {0} Value: {1}"
,
index_2, greetings[index_2]);
Console.WriteLine(
"Index: {0} Value: {1}"
,
index_3, greetings[index_3]);
Console.WriteLine(
"Index: {0} Value: {1}"
,
index_4, greetings[index_4]);
}
}
}