Strings - General Questions Online Exam Quiz

Strings - General Questions GK Quiz. Question and Answers related to Strings - General Questions. MCQ (Multiple Choice Questions with answers about Strings - General Questions

Which of the following function sets first n characters of a string to a given character?

Options

A : strinit()

B : strnset()

C : strset()

D : strcset()

View Answer

If the two strings are identical, then strcmp() function returns

Options

A : -1

B : 1

C : 0

D : Yes

View Answer

How will you print on the screen?

Options

A : printf(" ");

B : echo "\n";

C : printf(' ');

D : printf("\n");

View Answer

The library function used to find the last occurrence of a character in a string is

Options

A : strnstr()

B : laststr()

C : strrchr()

D : strstr()

View Answer

Which of the following function is used to find the first occurrence of a given string in another string?

Options

A : strchr()

B : strrchr()

C : strstr()

D : strnset()

View Answer

Which of the following function is more appropriate for reading in a multi-word string?

Options

A : printf();

B : scanf();

C : gets();

D : puts();

View Answer

Which of the following function is correct that finds the length of a string?

Options

A : int xstrlen( char *s) { int length= 0 ; while (*s!= '' ) { length++; s++; } return (length); }

B : int xstrlen( char s) { int length= 0 ; while (*s!= '' ) length++; s++; return (length); }

C : int xstrlen( char *s) { int length= 0 ; while (*s!= '' ) length++; return (length); }

D : int xstrlen( char *s) { int length= 0 ; while (*s!= '' ) s++; return (length); }

View Answer

Which of the following statements are true about the C#.NET code snippet given below?

Options

A : 1, 2, 4

B : 2, 3, 5

C : 3, 4

D : 2, 5

View Answer

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

Options

A : ARE

B : CRE

C : CR

D : REA

View Answer

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

Options

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();

View Answer

Arrays - General Questions more Online Exam Quiz

Floating Point Issues - General Questions

Attributes - General Questions

Classes and Objects - General Questions

Collection Classes - General Questions