Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
prime numbers 1-100
//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) { //Your code goes here bool isPrime = true; 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; } } if (isPrime) { Console.Write("\t" +i); } isPrime = true; } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
save bitmap from stream problem
Swap numbers without the third variable using the XOR operator
Convert string to TimeSpan in C#
Dependency Injection - with class
Get Round of 5 c# Vishal
My Test
Collections
Encryption & Decryption AES C#
lasses, properties, methods, ling begining
Extract all possible substrings from a string
Please log in to post a comment.