C# C# Basics (Retired) Perform if

string language = Console.ReadLine(); if(language==“C#”) { Console.WriteLine(“C# Rocks!”); } //NG

it seems right but do not work

CodeChallenge.cs
using System;
string language = Console.ReadLine();
if(language==C#”)
{
    Console.WriteLine(C# Rocks!);
}

1 Answer

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 47,300 Points

using System isn't necessary for this challenge and is one of the reasons it fails. The second reason is the quotes you are using. Did you copy them from the challenge or are you using a phone? You'll want the straight quotes instead of curly quotes. You can tell when they are used by the syntax coloring in that the quotes and all the text between will be orange.

" Vs. “

string language = Console.ReadLine();
if(language=="C#")
{
    Console.WriteLine("C# Rocks!");
}

-----------------------------------

string language = Console.ReadLine();
if(language==C#“)
{
    Console.WriteLine(C# Rocks!);
}