ExamVeda
Login
Home
41
How do you access the element at the second row and third column of a two-dimensional array named 'matrix' in C++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
42
Which of the following is true regarding the declaration of a string in C++ using the char array?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
43
Which is an instantiation of the basic_string class template?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str="Steve Jobs founded the apple";
    string str2 = str.substr (6, 4);
    unsigned pos = str.find("the");
    string str3 = str.substr (pos);
    cout << str2 << ' ' << str3 << '\n';
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What will be the output of the following C++ code?
#include <stdio.h>
#include<iostream>
using namespace std;
int main()
{
    int a = 5, b = 10, c = 15;
    int arr[3] = {&a, &b, &c};
    cout << *arr[*arr[1] - 8];
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
46
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str ("Steve jobs");
    cout << str.length();
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
47
What will happen if a string is empty?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
48
How many parameters can a resize method take?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
49
What will be the output of the following C++ code?
#include <stdio.h>
#include <iostream>
using namespace std;
int main()
{
    int array[] = {10, 20, 30};
    cout << -2[array];
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
50
What is the difference between unsigned int length() and unsigned int size()?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board