Find Odd and Even number csharp code example
Example 1: odd or even in c#
if(num %2 == 0){
Console.WriteLine("Number is even")
}else{
Console.WriteLine("Number is odd")
}
Example 2: c# if int is even
int i = 5;
if (i % 2 == 0)
{
// even
}
else
{
// odd
}