Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project Euler No 2
//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) { ulong n1 = 1; ulong n2 = 1; ulong n3 = 0; ulong sum = 0; while (n3<4000000) { n3 = n1 + n2; Console.Write(n3 + " "); if ((n3%2)==0){sum+=n3;} n1 = n2; n2 = n3; } if (sum == 4613732) {Console.Write("result found ");Console.Write(sum);} else {Console.Write("result not found ");Console.Write(sum);}} } }
run
|
edit
|
history
|
help
0
reverse a stack
Compiler
User
Asignacion 692018
Hi
SimpleHelloworldProgram
Viktor's example
DSXSAXS
The Code Garage
List Array