Challenge: 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
".
main.cs
123456789101112131415161718192021using System; namespace ConsoleApp { class Program { static void Main(string[] args) { int x = 77; if (___) { ___ } ___ { ___ } } } }
Modify the values in the expression 0 <= value && value <= 100
for forming the conditional expression.
main.cs
123456789101112131415161718192021using 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"); } } } }
Thanks for your feedback!
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Can you show me how to modify the expression for the range 70 to 90?
What would the full conditional statement look like for this range?
Can you explain why both 70 and 90 are included in the range?
Awesome!
Completion rate improved to 1.59
Challenge: if, else-if, else
Swipe to show menu
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
".
main.cs
123456789101112131415161718192021using System; namespace ConsoleApp { class Program { static void Main(string[] args) { int x = 77; if (___) { ___ } ___ { ___ } } } }
Modify the values in the expression 0 <= value && value <= 100
for forming the conditional expression.
main.cs
123456789101112131415161718192021using 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"); } } } }
Thanks for your feedback!