Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
25
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int i,p,n,d; Console.WriteLine("PRIME NUMBER CHECKING"); Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~"); { Console.WriteLine("Enter the value for checking:"); n =Convert.ToInt16(Console.ReadLine()); p = 0; for (i=2;i<=n/2;i++) { if (n % i == 0) { p++; break; } } if (p == 0) { Console.WriteLine("The given number is prime number"); } else { Console.WriteLine("The given number is not prime number"); } Console.ReadLine(); } } }
run
|
edit
|
history
|
help
0
List_methods
C# - out parameters and reference parameters
4
Enemy Spawner
scanf1
Uri Parts
jdiwnnx cf
Dijkstra’s shortest path algorithm
Bg
Implementing two interfaces with the same method signature