Advertisement
hnyrenhjm5678

Dom Kris 9v

Jan 27th, 2025
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
  8.         ShowEvenNumbers(numbers);
  9.     }
  10.  
  11.     static void ShowEvenNumbers(int[] numbers)
  12.     {
  13.         for (int i = 0; i < numbers.Length; i++)
  14.         {
  15.             if (numbers[i] % 2 == 0)
  16.             {
  17.                 Console.WriteLine(numbers[i]);
  18.             }
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement