Skip to content

Instantly share code, notes, and snippets.

@EslaMx7
Created February 7, 2014 12:26
Show Gist options
  • Save EslaMx7/8861773 to your computer and use it in GitHub Desktop.
Save EslaMx7/8861773 to your computer and use it in GitHub Desktop.
Project Euler Problem 1 Solution with C#
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