using System;
using System.Linq;
namespace Prog
{
public class Program
public static void Main(string[] args)
String str = "15 0 87 2 34";
String[] nums = str.Split(' ');
var evenNumbers = nums.Where(i => Convert.ToInt32(i) % 2 == 0);
foreach (String i in evenNumbers)
Console.WriteLine(i);
}
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Verified answer
using System;
using System.Linq;
namespace Prog
{
public class Program
{
public static void Main(string[] args)
{
String str = "15 0 87 2 34";
String[] nums = str.Split(' ');
var evenNumbers = nums.Where(i => Convert.ToInt32(i) % 2 == 0);
foreach (String i in evenNumbers)
Console.WriteLine(i);
}
}
}