Question 1 of 25
Hints left: 3
Q1
What does the 'strcpy()' function do in C++?
Q2
What is the output of the following code snippet in C++? char str[] = "Hello"; cout << sizeof(str);
Q3
Which of the following correctly defines a string variable named name initialized with the value "John" in C++?
Q4
What is the purpose of the 'toupper()' function in C++?
Q5
What is the output of the following code: char str[] = "Hello"; cout << str; in C++?
Q6
What is the output of the following code snippet in C++? int arr[] = {1, 2, 3, 4, 5}; cout << arr[5];
Q7
Which of the following statements is true about array indices in C++?
Q8
What is the purpose of the 'strcat()' function in C++?
Q9
In C++, which function is used to read a string with spaces using cin?
Q10
What does the 'strncpy()' function do in C++?
Q11
What is the output of the following code: char str[] = "Hello"; cout << str[5]; in C++?
Q12
What is the correct syntax for declaring a two-dimensional array in C++?
Q13
What is the purpose of the 'strcmp()' function in C++?
Q14
How do you determine the length of a C-style string in C++?
Q15
Which of the following statements is true about C-style strings in C++?
Q16
What is the correct way to initialize a string object named 'str' in C++?
Q17
What is the output of the following code: char str[] = "Hello"; cout << sizeof(str); in C++?
Q18
What is the purpose of the 'strtok()' function in C++?
Q19
Which of the following correctly initializes a two-dimensional array named matrix in C++ with dimensions 3x3?
-
A
-
B
-
C
-
D
Q20
What is the correct way to pass an array as an argument to a function in C++?
Q21
What is the output of the following code snippet in C++? char str[] = "Hello"; cout << str[4];
Q22
What is the correct way to access the last element of an array named arr in C++?
Q23
What is the correct way to access the fifth character in a string variable named text in C++?
Q24
What is the correct way to declare a string object named myString and initialize it with the value "Welcome" in C++?
Q25
Which of the following correctly declares an array of 10 integers in C++ and initializes all elements to zero?