ExamVeda
Login
Home
51
How does the strings are stored in the memory?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
52
What will be the output of the following C++ code?
#include <stdio.h>
#include<iostream>
using namespace std;
int array1[] = {1200, 200, 2300, 1230, 1543};
int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
int main()
{
    for (temp = 0; temp < 5; temp++) 
    {
        result += array1[temp];
    }
    for (temp = 0; temp < 4; temp++)
    {
        result += array2[temp];
    }
    cout << result;
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
53
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.capacity() << "\n";
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
54
How many maximum number of parameters does a string constructor can take?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
55
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str;
    string str2="Steve jobs";
    string str3="He founded apple";
    str.append(str2);
    str.append(str3, 6, 3);
    str.append(str3.begin() + 6, str3.end());
    str.append(5,0x2e);
    cout << str << '\n';
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
56
Which of the following accesses the seventh element stored in array?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
What is the correct definition of an array?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
58
Which of the following gives the memory address of the first element in array?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
59
Which character is used to terminate the string?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
60
Where are the strings stored?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board