Complete the code to check if a number is positive.
int number = 5; if (number [1] 0) { Console.WriteLine("Positive number"); }
The condition should check if the number is greater than zero to be positive.
Complete the code to print "Even" if the number is even.
int num = 4; if (num % 2 [1] 0) { Console.WriteLine("Even"); }
The remainder when dividing by 2 is zero for even numbers.
Fix the error in the if-else statement to correctly print "Negative" or "Non-negative".
int val = -3; if (val [1] 0) { Console.WriteLine("Negative"); } else { Console.WriteLine("Non-negative"); }
To print "Negative", the condition should check if val is less than zero.
Fill both blanks to print "Adult" if age is 18 or more, otherwise "Minor".
int age = 20; if (age [1] 18) { Console.WriteLine("Adult"); } else { Console.WriteLine("[2]"); }
The condition checks if age is 18 or more (>= 18) to print "Adult"; otherwise, print "Minor".
Fill all three blanks to print "Fizz", "Buzz", or "FizzBuzz" based on divisibility.
int number = 15; if (number [1] 3 == 0 && number [2] 5 == 0) { Console.WriteLine("[3]"); }
Use the modulus operator '%' to check divisibility. If divisible by both 3 and 5, print "FizzBuzz".