Back to Freecodecamp

Evaluate Boolean Expressions to Make Decisions in C#

curriculum/challenges/english/blocks/add-logic-to-c-sharp-console-applications/647e21708acb466c97ccbee3.md

latest1.2 KB
Original Source

--description--

This challenge will be partially completed on the Microsoft Learn platform. Follow these instructions to complete the challenge:

  1. Go to <a href="https://learn.microsoft.com/training/modules/csharp-evaluate-boolean-expressions/" target="_blank" rel="noreferrer">https://learn.microsoft.com/training/modules/csharp-evaluate-boolean-expressions/</a> and complete all the tasks for the "Evaluate Boolean Expressions to Make Decisions in C#" module. This is required to earn the "Add Logic to C# Console Applications" trophy on Microsoft Learn, and qualify for the certification exam.
  2. When you are finished, come back and correctly answer the question below.

--assignment--

Complete the <a href="https://learn.microsoft.com/training/modules/csharp-evaluate-boolean-expressions/" target="_blank" rel="noreferrer">Evaluate Boolean Expressions to Make Decisions in C#</a> module on Microsoft Learn. Then, answer the question below.

--questions--

--text--

Which of the following lines of code is a valid use of the conditional operator?

--answers--

int value = amount >= 10 ? 10 : 20;


int value = amount >= 10 : 10 ? 20;


int value = amount >= 10 ? 10 | 20;

--video-solution--

1