কম্পিউটার

C# প্রশ্নযোগ্য ইউনিয়ন পদ্ধতি


প্রশ্নযোগ্য ইউনিয়ন পদ্ধতি ব্যবহার করে দুটি ক্রমানুসারে ইউনিয়ন সম্পাদন করুন।

নিম্নলিখিত আমাদের অ্যারে আছে.

int[] arr1 = { 29, 40, 15, 55, 70, 30, 90 };
int[] arr2 = { 30, 36, 40, 18, 15, 55, 75 };

এখন, ইউনিয়ন পদ্ধতি ব্যবহার করে অ্যারের ইউনিয়ন পান।

arr1.AsQueryable().Union(arr2);

উদাহরণ

using System;
using System.Linq;
using System.Collections.Generic;
public class Demo {
   public static void Main() {
      int[] arr1 = { 29, 40, 15, 55, 70, 30, 90 };
      int[] arr2 = { 30, 36, 40, 18, 15, 55, 75 };
      IEnumerable<int> res = arr1.AsQueryable().Union(arr2);
      foreach (int a in res)
      Console.WriteLine("{0} ", a);
   }
}

আউটপুট

29
40
15
55
70
30
90
36
18
75

  1. C# এ GroupBy() পদ্ধতি

  2. C# এ CompareTo() পদ্ধতি

  3. C# এ ইউনিয়ন পদ্ধতি

  4. অ্যারে#জিপ পদ্ধতি