Multiple choice technology programming languages

Which of these is a valid path declaration?

  1. string s="c:\abc.txt";

  2. string s="c:/abc.txt";

  3. string s=@"c:\abc.txt";

  4. All are correct

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

C# supports multiple path declaration formats. Double backslash escapes the backslash character (c:\abc.txt becomes c:\abc.txt at runtime). Forward slashes work in Windows paths (c:/abc.txt). Verbatim string literals using @ prefix treat backslashes literally (@"c:\abc.txt"). All three syntaxes are valid C# string declarations for file paths.