mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 17:25:39 +01:00
Updated to simpler example.
Now prints prime numbers from 1 to 100.
This commit is contained in:
parent
074a0cc08b
commit
9c914da118
1 changed files with 26 additions and 11 deletions
|
|
@ -1,23 +1,38 @@
|
||||||
|
/*
|
||||||
|
* C# Program to Display All the Prime Numbers Between 1 to 100
|
||||||
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace VS
|
namespace PrimeNumber
|
||||||
{
|
{
|
||||||
class Program
|
class Program
|
||||||
{
|
{
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
ProcessStartInfo si = new ProcessStartInfo();
|
bool isPrime = true;
|
||||||
float load= 3.2e02f;
|
Console.WriteLine("Prime Numbers : ");
|
||||||
|
for (int i = 2; i <= 100; i++)
|
||||||
|
{
|
||||||
|
for (int j = 2; j <= 100; j++)
|
||||||
|
{
|
||||||
|
if (i != j && i % j == 0)
|
||||||
|
{
|
||||||
|
isPrime = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
si.FileName = @"tools\\node.exe";
|
if (isPrime)
|
||||||
si.Arguments = "tools\\simpleserver.js";
|
{
|
||||||
|
Console.Write("\t" +i);
|
||||||
Process.Start(si);
|
}
|
||||||
|
isPrime = true;
|
||||||
|
}
|
||||||
|
Console.ReadKey();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue