Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Chapter04/Listing04.22.NestedIf.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ public static void Main()
input = int.Parse(Console.ReadLine());

// Condition 1.
if (input <= 0) // line 16
if (input <= 0)
// Input is less than or equal to 0
Console.WriteLine("Exiting...");
else
// Condition 2.
if (input < 9) // line 20
if (input < 9)
// Input is less than 9
Console.WriteLine(
$"Tic-tac-toe has more than {input}" +
" maximum turns.");
else
// Condition 3.
if (input > 9) // line 26
if (input > 9)
// Input is greater than 9
Console.WriteLine(
$"Tic-tac-toe has fewer than {input}" +
" maximum turns.");
// Condition 4.
else
// Input equals 9
Console.WriteLine( // line 33
Console.WriteLine(
"Correct, tic-tac-toe " +
"has a maximum of 9 turns.");
#endregion INCLUDE
Expand Down
Loading