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
entero_hacia_string
1.3 Basics: interfaces
combine paths
binary search find minimum
sdfrgthyjui65trfvf
ex8 For_Loop
my wall
ExtensionDateTime
Array Foreach with sum
Kumaran - Regex IP Match