Maya P.

asked • 09/08/20

Programming with C#

Hi, 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.

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.