C# how to know if number is even or odd

37

C# how to know if number is even or odd -

if(num%2 == 0){
  Console.WriteLine("Number is even")
}else{
  Console.WriteLine("Number is odd")
}

Comments

Submit
0 Comments