Complete the code to print "Positive" if the number is greater than zero.
number = 5 if number [1] 0 puts "Positive" end
The condition should check if number is greater than zero using >.
Complete the code to print "Zero" if the number equals zero.
number = 0 if number > 0 puts "Positive" elsif number [1] 0 puts "Zero" end
The elsif condition should check if number is equal to zero using ==.
Fix the error in the code to print "Negative" if the number is less than zero.
number = -3 if number > 0 puts "Positive" elsif number == 0 puts "Zero" else puts "[1]" end
The string should be exactly "Negative" to match the expected output.
Fill both blanks to complete the code that prints "Even" if the number is even, otherwise "Odd".
number = 4 if number [1] 2 == 0 puts "Even" else puts "[2]" end
The modulo operator % checks the remainder. If remainder is zero, number is even. Otherwise, print "Odd".
Fill all three blanks to complete the code that categorizes a number as positive, zero, or negative.
number = -1 if number [1] 0 puts "Positive" elsif number [2] 0 puts "Zero" else puts "[3]" end
The first condition checks if number is greater than zero, second checks equality to zero, else prints "Negative".