Created
February 7, 2014 12:26
-
-
Save EslaMx7/8861773 to your computer and use it in GitHub Desktop.
Project Euler Problem 1 Solution with C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsolesTests | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int NUM = 1000; | |
int res =0; | |
for (int i = 3; i < NUM; i++) | |
{ | |
if (i % 3 == 0 || i % 5 == 0) | |
res += i; | |
} | |
Console.WriteLine("\n Done... and the Result is : " + res); // 233168 | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment