SHARE
TWEET

C#

a guest Oct 21st, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Collections;
  7.  
  8. namespace ConsoleApp2
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             ArrList();
  15.         }
  16.  
  17.         static void ArrList()
  18.         {
  19.             ArrayList Numbers = new ArrayList();
  20.             Numbers.Add(7);
  21.             Numbers.Add(7);
  22.             Numbers.Add(5);
  23.  
  24.             foreach (int i in Numbers)
  25.             {
  26.                 Console.WriteLine(i);
  27.             }
  28.  
  29.             int IndexOfSeven = Numbers.IndexOf(7);
  30.             Console.WriteLine("index is:" + IndexOfSeven);
  31.  
  32.             Console.ReadLine();
  33.         }
  34.     }
  35.  
  36. }
  37. using System;
  38. using System.Collections.Generic;
  39. using System.Linq;
  40. using System.Text;
  41. using System.Threading.Tasks;
  42. using System.Collections;
  43.  
  44. namespace ConsoleApp2
  45. {
  46.     class Program
  47.     {
  48.         static void Main(string[] args)
  49.         {
  50.             ArrList();
  51.         }
  52.  
  53.         static void ArrList()
  54.         {
  55.             ArrayList Numbers = new ArrayList();
  56.             Numbers.Add(7);
  57.             Numbers.Add(7);
  58.             Numbers.Add(5);
  59.  
  60.             foreach (int i in Numbers)
  61.             {
  62.                 Console.WriteLine(i);
  63.             }
  64.  
  65.             int IndexOfSeven = Numbers.IndexOf(7);
  66.             Console.WriteLine("index is:" + IndexOfSeven);
  67.  
  68.             Console.ReadLine();
  69.         }
  70.     }
  71.  
  72. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top