Quantcast
Channel: VBForums - Code It Better
Viewing all articles
Browse latest Browse all 16

VB.NET Project Euler

$
0
0
Thought I'd take a stab at the Project Euler questions. If anyone has any suggestions on how to improve these I'm all ears.

1. Add all the natural numbers below one thousand that are multiples of 3 or 5.

vb.net Code:
  1. Private Function Problem1() As Integer
  2.         Return Enumerable.Range(1, 999) _
  3.             .Where(Function(x) {3, 5}.Any(Function(y) x Mod y = 0)) _
  4.             .Sum()
  5.     End Function

Viewing all articles
Browse latest Browse all 16

Trending Articles