Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: else Keyword | Control Structures
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Basics

book Challenge: else Keyword

Task

Swipe to start coding

  • Declare an integer variable age to store the user’s age.
  • Declare a boolean variable isMember to indicate if the user is a member.
  • Use an if-else statement to check the following conditions:
    • If the user is 65 or older or isMember is true, print: Eligible for discount
    • Otherwise, print: Not eligible for discount

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 11
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

book Challenge: else Keyword

Swipe to show menu

Task

Swipe to start coding

  • Declare an integer variable age to store the user’s age.
  • Declare a boolean variable isMember to indicate if the user is a member.
  • Use an if-else statement to check the following conditions:
    • If the user is 65 or older or isMember is true, print: Eligible for discount
    • Otherwise, print: Not eligible for discount

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 11
single

single

some-alt