C# 1001 notes
6.51K subscribers
329 photos
9 videos
2 files
313 links
Регулярные короткие заметки по C# и .NET.

Просто о сложном для каждого.

admin - @haarrp
加入频道
Here is a solution for the #challenge above

💬 Personally, I like the first solution more, it is much more expressive!
#challenge

💻 Check if a Number is Prime | #easy

Create a function that returns true if a number is prime, and false otherwise. A prime number is any positive integer that is evenly divisible by only two divisors: 1 and itself.

The first ten prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29

Examples:

isPrime(31) ➞ true
isPrime(18) ➞ false
isPrime(11) ➞ true

For your convenience: dotnetfiddle.

🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇

#interview