• //23-masala: Massivni aylantirish int[] numbers = { 10, 20, 30, 40, 50 }; Array.Reverse(numbers); //24-masala: Massivni klonlash
  • //21-masala: Massivni kesishish




    Download 22,12 Kb.
    bet4/4
    Sana14.05.2024
    Hajmi22,12 Kb.
    #232468
    1   2   3   4
    Bog'liq
    DASTURIY INJENERING (2)

    //21-masala: Massivni kesishish
    int[] numbers1 = { 10, 20, 30, 40, 50 };
    int[] numbers2 = { 30, 40, 50, 60, 70 };
    int[] intersected = numbers1.Intersect(numbers2).ToArray();

    //22-masala: Massivni farqlash
    int[] numbers1 = { 10, 20, 30, 40, 50 };
    int[] numbers2 = { 30, 40, 50, 60, 70 };
    int[] excepted = numbers1.Except(numbers2).ToArray();

    //23-masala: Massivni aylantirish
    int[] numbers = { 10, 20, 30, 40, 50 };
    Array.Reverse(numbers);

    //24-masala: Massivni klonlash
    int[] numbers = { 10, 20, 30, 40, 50 };
    int[] cloned = (int[])numbers.Clone();

    //25-masala: Massivni dictga aylantirish
    int[] numbers = { 10, 20, 30, 40, 50 };
    Dictionary dict = numbers.ToDictionary(n => n, n => n * n);
    Download 22,12 Kb.
    1   2   3   4




    Download 22,12 Kb.