
Patrick B. answered 09/08/20
Math and computer tutor/teacher
you cannot chain the inequalities like that:
((11 < number ) && (number <21)) || ((34< number) && (number<48))
Maya P.
asked 09/08/20Hi, why does it become red in the following code?
/* Console.Write("Write a number: ");
int number = Convert.ToInt32(Console.ReadLine());
if (number % 2 == 0 && (11 < number < 21 || 34 < number < 48))
{
Console.WriteLine("Something");
} */
Why does the underlined code with the bigger than and less than expression get underlined with red? Visual Studio says its because the > cannot be applied to operands of type bool and double. I do not understand what it means.
Patrick B. answered 09/08/20
Math and computer tutor/teacher
you cannot chain the inequalities like that:
((11 < number ) && (number <21)) || ((34< number) && (number<48))
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Maya P.
Thank you so much!!09/10/20