Skip to content

Commit

Permalink
Envio do desafio 02 por @JefersonMarcante
Browse files Browse the repository at this point in the history
  • Loading branch information
JefersonMarcante committed Feb 12, 2024
1 parent 18fc914 commit a7403e2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
20 changes: 20 additions & 0 deletions desafio-02/JefersonMarcante/csharp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
bool EhPrimo(int num)
{
int aux = 0;

if (num < 2)
return false;

for(int j = 2; j <= num; j++)
if (num % j == 0)
aux++;

if (aux <= 1)
return true;

return false;
}

for (int i = 0; i < 10000; i++)
if (EhPrimo(i))
Console.WriteLine(i);
10 changes: 10 additions & 0 deletions desafio-02/JefersonMarcante/csharp/csharp.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>

0 comments on commit a7403e2

Please sign in to comment.