Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Task (if, else-if, else) | Control Structures
course content

Зміст курсу

C# Basics

Task (if, else-if, else)Task (if, else-if, else)

Write a condition for checking if the variable x is in the numerical range 70 to 90 (including 70 and 90). If it is in range, output the message "In Range", otherwise output "Not In Range".

cs

main.cs

1. Modify the values in the expression 0 <= value && value <= 100 for forming the conditional expression.

using System;

namespace ConsoleApp
{       
    class Program
    {
        static void Main(string[] args)
        {
            int x = 77;

            if (70 <= x && x <= 90)
            {
                Console.WriteLine("In Range");
            }
            else
            {
                Console.WriteLine("Not In Range");
            }
        }
    }
}
      

Все було зрозуміло?

Секція 3. Розділ 10
course content

Зміст курсу

C# Basics

Task (if, else-if, else)Task (if, else-if, else)

Write a condition for checking if the variable x is in the numerical range 70 to 90 (including 70 and 90). If it is in range, output the message "In Range", otherwise output "Not In Range".

cs

main.cs

1. Modify the values in the expression 0 <= value && value <= 100 for forming the conditional expression.

using System;

namespace ConsoleApp
{       
    class Program
    {
        static void Main(string[] args)
        {
            int x = 77;

            if (70 <= x && x <= 90)
            {
                Console.WriteLine("In Range");
            }
            else
            {
                Console.WriteLine("Not In Range");
            }
        }
    }
}
      

Все було зрозуміло?

Секція 3. Розділ 10
some-alt