IndiaBIX
IndiaBIX
Start typing & press "Enter" or "ESC" to close
  • Home
  • Jobs
  • Results
  • Current Affairs
  • GK
  • Online Test
  • HR Interview
  • BLOG

Strings - General Questions (2)

  • Home
  • Computer Science & Engineering
  • C# Programming Questions and Answers
  • Strings - General Questions
9. 

Which of the following will be the correct output for the C#.NET code snippet given below?

String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(s1.Length);

A. 3 6
B. 2 5
C. 3 5
D. 2 6
E. 3 7

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

10. 

Which of the following snippets are the correct way to convert a Single into a String?

1 Single f = 9.8f;
String s;
s = (String) (f);

2 Single f = 9.8f;
String s;
s = Convert.ToString(f);

3 Single f = 9.8f;
String s;
s = f.ToString();

4 Single f = 9.8f;
String s;
s = Clnt(f);

5 Single f = 9.8f;
String s;
s = CString(f);

A. 1, 2
B. 2, 3
C. 1, 3, 5
D. 2, 4

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

11. 

What will be the output of the C#.NET code snippet given below?

namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[ ] args)
{
string str= "Hello World!";
Console.WriteLine( String.Compare(str, "Hello World?" ).GetType() );
}
}
}

A. 0
B. 1
C. String
D. Hello World?
E. System.Int32

Answer: Option E

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

12. 

If s1 and s2 are references to two strings, then which of the following is the correct way to compare the two references?

A. s1 is s2
B. s1 = s2
C. s1 == s2
D. strcmp(s1, s2)
E. s1.Equals(s2)

Answer: Option E

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

13. 

Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai");
Console.WriteLine(s2);

A. NagpuMumbair
B. Nagpur Mumbai
C. Mumbai
D. Nagpur
E. NagpurMumbai

Answer: Option E

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

14. 

The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder class are mutable.

A. True
B. False

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

15. 

Which of the following statements will correctly copy the contents of one string into another ?

A. String s1 = "String"; String s2; s2 = s1;
B. String s1 = "String" ; String s2; s2 = String.Concat(s1, s2);
C. String s1 = "String"; String s2; s2 = String.Copy(s1);
D. String s1 = "String"; String s2; s2 = s1.Replace();
E. String s1 = "String"; String s2; s2 = s2.StringCopy(s1);

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

16. 

Which of the following will be the correct output for the C#.NET code snippet given below?

String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3);
Console.WriteLine(s2);

A. ARE
B. CRE
C. CR
D. REA
E. CREATED

Answer: Option B

Explanation:

No answer description available for this question. Let us discuss.
View Answer Discuss Workspace Report

  • 1
  • 2
  • 3

Questions & Answers

Aptitude Chemical Engineering Civil Engineering Computer Science & Engineering Current Affairs Data Interpretation Electrical & Electronics Engineering Electronics & Communication Engineering General Knowledge Logical Reasoning Mechanical Engineering Non Verbal Reasoning Verbal Ability Verbal Reasoning

Interviews

HR Interview

Jobs

Sarkari Jobs

Results

Rojgar ResultSarkari Result

Admission

Admission 2023

Admit Card

Admit Card 2023

Answer Key

Answer Key 2023
copyright
Privacy Policy
© 2026 IndiaBIX. All Rights Reserved.

Report