ExamVeda
Login
Home
21
What is the output of the following code snippet in C++? char str[] = "Hello"; cout << str[4];
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
22
In C++, which function is used to read a string with spaces using cin?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
23
What is the correct way to access the fifth character in a string variable named text in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
24
What is the purpose of the 'toupper()' function in C++?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
25
What is the output of the following code snippet in C++? char str[] = "Hello"; cout << sizeof(str);
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
26
What is the correct way to declare a string object named myString and initialize it with the value "Welcome" in C++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
27
What does the 'strncpy()' function do in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
28
What is the purpose of the 'strtok()' function in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
29
Which of the following statements is true about array indices in C++?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
30
What is the correct way to access the last element of an array named arr in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board