Simon Jalas has worked in the telecommunications industry since 2009. Simon began as a Contractor for TeleGo Communications, where they built and managed a highly secure network and setup Telecommunications Switches and a Hosted PBX solution with a massive backup system. In 2013, they became the CTO of AAA Networking. In 2014, they became the Co-Founder and CTO of Savecom Telecom, which provides enterprise-grade Hosted VoIP and Unified Communications to businesses and institutions.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _04.Sieve_of_Eratosthenes
{
class Program
{
static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
bool[] arr = new bool[n + 1];
for (int i = 0; i <= n; i++)
{
arr[i] = true;
}
arr[0] = arr[1] = false;
for (int i = 0; i <= n; i++)
{
if (arr[i] == true)
{
Console.Write(i + " ");
for (int j = 2; j * i <= n; j++)
{
arr[j * i] = false;
}
}
}
Console.WriteLine();
}
}
}
Sign up to view 0 direct reports
Get started
This person is not in any teams