Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
erhm, did you not notice the top solution? ;)
I know this is 17 months old, but thank you for this! I actually didnt know you could remove the else and just add another return for "Odd".
The Func part is a delegate and the (x) => ... part is a lambda expresion but I don't know the advantage of using them here.
if its not too much to ask what is Func<int,string> and the => part
i just wanted to say that i personally drop the else statement when the if statement contains a return statement since it will exit the method.
As g964 says in your post below, you are missing a using statement - add
using System;
above everything else in your solution.Math
is short forSystem.Math
in C#, but you need the initial using statement for this to work.Alternatively you could replace
Math
withSystem.Math
everywhere in your solution.using C#
i am getting this error. code work fine on Visual studion on my local machine.
i googled it but it seems to be something concerning namespaces but i cant pin it down.
any ideas?
src/Solution.cs(11,28): error CS0103: The name 'Math' does not exist in the current context
Please before posting issues look at the top of the page: 4975 people passed the C# kata so you could have seen that it's not an issue of the kata but a problem of your code. To use Math.Pow you need "using System;".
it gave me an error while using c#
it didnt recognize Math.Pow()
solution worked on my local machine just fine
Nice!
or just return a in the else sa=tatement as i did
In that case a == b, so it's indifferent which of them is returned. In the current case b will be returned, but the condition could be a >= b as well in which case a would be returned when the are equal.
then either one is ok
what if numbers were equal?