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

Joel Muro
Joel Muro
2,884 Points

if objective

iknow you have to put console.write("C# Rocks!");

if(language=="C#") {

}

where do i go from here for the objective

Rob B
Rob B
11,677 Points

in between the {} is where you would put that console.write. :)

1 Answer

Steven Parker
Steven Parker
173,904 Points

Remember that C# is case-sensitive. So console.write is not the same thing as Console.Write.

Being careful with case and putting the write statement inside the braces, you'll have:

string language = Console.ReadLine();
if (language == "C#") {
  Console.Write("C# Rocks!");
}
Rob B
Rob B
11,677 Points

That too. Thanks for catching that. I've got my head buried in the CSS Selectors course at the moment.

Steven Parker
Steven Parker
173,904 Points

Remember to select a "best answer" :)