निम्नलिखित हमारी सरणी है -
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7}; पहला तत्व प्राप्त करने के लिए, पहले () विधि का उपयोग करें।
myArr.AsQueryable().First();
आइए देखें पूरा कोड -
उदाहरण
using System;
using System.Linq;
using System.Collections.Generic;
class Demo {
static void Main() {
double[] myArr = {20.5, 35.6, 45.7, 55.6, 79.7};
double res = myArr.AsQueryable().First();
Console.WriteLine(res);
}
} आउटपुट
20.5