C# C# Basics (Retired) Perform if / else

I dont understand why the else statement wont work

I made sure i included the System namespace

string language = Console.ReadLine();

if(language == "C#")
  System.Console.WriteLine("C# Rocks!");
    System.Console.WriteLine(language + "is not C#.");

1 Answer

Jason Anders
Jason Anders
Treehouse Moderator 144,865 Points

HI Travis,

Your syntax is correct, but remember the spacing when concatenating strings. Right now if someone entered "Cheese", your string would return Cheeseis not C#.

Just fix up that missing space and the rest is good.

Nice Work! :) :dizzy: