ExamVeda
Login
Home
61
Pick out the correct option.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
62
What is the identifier given to string class to declare string objects?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
63
Which is used to do the dereferencing?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
64
Pick out the correct statement.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
65
What will be the output of the following C++ code?
#include  <iostream>
using namespace std;
int main()
{
    double arr[] = {5.0, 6.0, 7.0, 8.0};
    double *p = (arr+2);
    cout << *p << endl;   
    cout << arr << endl;  
    cout << *(arr+3) << endl;
    cout << *(arr) << endl;  
    cout << *arr+9 << endl;  
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
66
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class B
{
	int b;
    public:
	B(){}
	B(int i){
		b = i;
	}
	int show(){
		return b;
	}
};
 
class C
{
	B b;
    public:
	C(int i){
		b = B(i);
	}
	friend void show(){
 
		C c(10);
		cout<<"value of b is: "<<c.b.show()<<endl;
	}
};
 
int main(int argc, char const *argv[])
{
	C c(1);
	c.show();
	return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
67
Which is the correct way of concatenating a character at the end of a string object?
way 1:
string s;
s = s + 'a';
 
way 2:
string s;
s.push_back('a');
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
68
What will be the output of the following C++ code?
#include <iostream> 
#include <string>
using namespace std; 
int main(int argc, char const *argv[])
{
	string s1 = "Hello";
	string s2 = "World";
	string s3 = s1 + " " + s2;
	cout<<s3;
	return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
69
When we are using heap operations what do we need to do to save the memory?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
70
Which method do we use to append more than one character at a time?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board