Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Collatz Conjecture, using Pi
//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) { float n = 5; double pi = Math.PI; Console.WriteLine(pi); for(int i = 1; i < pi;) { //Even if(pi % 2 == 0) { pi = pi/2; Console.WriteLine(pi); } //Odd if(pi % 2 != 0 && pi != 1) { pi = 3*pi+1; Console.WriteLine(pi); } } } } }
run
|
edit
|
history
|
help
0
Variables
Sample Linq Test
Delegates
Detaylar
Intuit // C# // listing_4.5 (Math. /Pow /Sin)
decimal to binary conversion
Using System.Reflection to find Property Name and Value of any Generic Class
towers of hanoi
stockSeries
Math Course: Remainders