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
Date format display
EFCXAXS
Main5
Variables
exception implicit toString
card 2
Bitcoins expectative :'v
MightConst - Runtime Constwrapper Value (C#)
Server last restarted
Decimal separator diff