Menu
×
×
Correct!

Exercise:

Insert the missing parts to complete the following "short hand if...else statement" (ternary operator):

int time = 20; string result = (time < 18) ? "Good day." : "Good evening."; Console.WriteLine(result);

Not Correct

Click here to try again.

Correct!

Next ❯
int time = 20;
string result = time < 18  "Good day."  "Good evening.";
Console.WriteLine(result);

  
  
  




Completed 0 of 58 Exercises:

C# Syntax
C# Comments
C# Variables
C# Data Types
C# User Input
C# Operators
C# Math
C# Strings
C# Booleans
C# If...Else
C# Switch
C# Loops
C# Arrays
C# Methods
C# Classes/Objects
C# Exceptions

×

Reset the Score?

This will reset the score of ALL 58 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 58 C# exercises.

Share your score: