Ruby Program to find odd or even number

Program

puts "Enter a number:"
num = gets.chomp.to_i
if num % 2 == 0 then
    print "Entered number is even\n"
else
    print "Entered number is odd\n"
end

Output 1

$ ruby odd-or-even.rb
Enter a number:
6
Entered number is even

Output 2

$ ruby odd-or-even.rb
Enter a number:
5
Entered number is odd