VOOZH about

URL: https://www.geeksforgeeks.org/quizzes/string-data-structure-quiz-for-beginners/

⇱ Quiz about String Data Structure Quiz for Beginners


Last Updated :
Discuss
Comments

Question 1

string a = "10";
string b = "20";
string c = a + b;

Guess the output:

  • "10 20"

  • 30

  • 10 20

  • 1020

Question 2

What the below program will  Print?

  • 0

  • 1

  • 5

  • 11

Question 3

Which of these methods of class String is used to obtain the length of the String object?

  • get()

  • Sizeof()

  • lengthof()

  • length()

Question 4

What is the output of the below code?

  • eksForGeeks

  • ForGEeks

  • Geeks

  • orGeeks

Question 5

Which of the following is a palindromic string?

  • "APPLE"

  • "ABCDE"

  • "APPLA"

  • "ABCCBA"

Question 6

What is the time complexity to reverse a string?

  • O(n^2)

  • O(1)

  • O(log n)

  • O(n)

Question 7

Which of these methods from the String class is used to extract a single character from an object of String?

  • CHARAT()

  • charAt()

  • CharAt()

  • charAT()

Question 8

How does strcmp() function work to compare two strings?

  • It compares characters based on their index.

  • It compares strings based on the index.

  • It compares characters of the string based on their ASCII values.

  • None.

Question 9

Which of the following statement is a binary string?

  • "ab"

  • "121212"

  • "01010101110"

  • None

Question 10

What is the output of the following code?

  • Error

  • G !

  • F !

  • None

There are 20 questions to complete.

Take a part in the ongoing discussion