Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
prime number
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { Console.Write("Enter a Number : "); int num; num = Convert.ToInt32(Console.ReadLine()); int k; k = 0; for (int i = 1; i <= num/2; i++) { if (num % i == 0) { k++; } } if (k == 2) { Console.WriteLine("Entered Number is a Prime Number and the Largest Factor is {0}",num); } else { Console.WriteLine("Not a Prime Number"); } Console.ReadLine(); } } }
run
|
edit
|
history
|
help
1
Metodos y como llmarlos
Fórum ➡ Parallel Threads ( The Funniest Version ) ♦
test
Working with Strings
30272 Program Ex7_1 switch_int
asdfghjiu
enum.TryParse
multiplo de 500
test
3. Delegates and events: closure