Advertisement
mess0011

u5_1

Apr 27th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication107
  8. {
  9.  
  10.     class array_numbers
  11.     {
  12.         private int[] even = new int[25];
  13.         private int[] odd = new int[25];
  14.         private int count_even = 0;
  15.         private int count_odd = 0;
  16.  
  17.         public int even_numbers
  18.         {
  19.           get
  20.             {
  21.                 Console.Write("Even Numbers:");
  22.                 for(int i = 0; i<25; i++)
  23.                 {
  24.                     Console.WriteLine("{0}"; even[i]);
  25.                 return 0;
  26.                 }
  27.             }
  28.         public int odd_numbers
  29.         {
  30.             get
  31.             {
  32.                 Console.Write("Odd Numbers:");
  33.                 for(int i = 0; i<25; i++)
  34.                 {
  35.                     Console.WriteLine("{0}";odd[i]);
  36.                 return 0;
  37.                 }
  38.             }
  39.         public void fillnumberarray(int nr)
  40.         {
  41.             if(nr%2 == 0)
  42.             {
  43.                 even[count_even] = nr;
  44.                 count_even++;
  45.             }
  46.             if(nr%2 == 1)
  47.             {
  48.                 odd[count_odd] = nr;
  49.                 count_odd++;
  50.             }
  51.         }
  52.        
  53.        
  54.         class Program
  55.         {
  56.             static void Main(string[] args)
  57.             {
  58.                 Console.ReadLine();
  59.  
  60.             }
  61.         }
  62.     }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement