For two strings s1 and s2 to be equal, which is the correct way to find if the contents of two strings are equal?
A. if(s1 = s2)
B. int c;
c = s1.CompareTo(s2);
C. if (s1 is s2)
D. if(strcmp(s1, s2))
Answer: Option B
A. if(s1 = s2)
B. int c;
c = s1.CompareTo(s2);
C. if (s1 is s2)
D. if(strcmp(s1, s2))
Answer: Option B
What is the correct syntax to declare a variable in C#?
A. num = int;
B. var num;
C. num int;
D. int num;
What is the purpose of the 'var' keyword in C#?
A. Declares a constant
B. Converts a variable to string
C. Implicitly declares a variable
D. Defines a method
Join The Discussion