Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Operators | Section
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
C# Basics
Sectionย 1. Chapterย 27
single

single

bookChallenge: Operators

Swipe to show menu

Task

Swipe to start coding

  • Declare an int variable for the user's age.
  • Declare a bool variable for membership status.
  • Use comparison operators (>=) to check if age is 65 or older.
  • Use logical operators (||) to check if the user is a member.
  • Use a ternary operator (?:) to assign the message "Eligible for discount" or "Not eligible for discount" based on the conditions.
  • Print the message to the console using Console.WriteLine.

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ย 1. Chapterย 27
single

single

Ask AI

expand

Ask AI

ChatGPT

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

some-alt