Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: if, else-if, else | Control Structures
C# Basics

bookChallenge: 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

main.cs

copy
123456789101112131415161718192021
using 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

main.cs

copy
123456789101112131415161718192021
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"); } } } }

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 10

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

What should the new values be in the conditional expression?

Can you show me how to write the condition for the range 70 to 90?

Do you want an example using a specific programming language?

Awesome!

Completion rate improved to 1.59

bookChallenge: if, else-if, else

Stryg for at vise menuen

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

main.cs

copy
123456789101112131415161718192021
using 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

main.cs

copy
123456789101112131415161718192021
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"); } } } }

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 10
some-alt