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
Intuit // C# // Lecture_4 // Laba_#1
1.1 Basics: language constructs
Shift Example
Planet-D ver. 0.7
Heap sort
C# constructor in inheritance
D112
Testing for Integers and Floats in a String
Binary Hex Decimal Systems
Single Line Date in Months