ExamVeda
Login
Home
31
What does a class in C++ holds?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
32
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 str;
	cin>>str;
	cout<<str;
	return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
33
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
 
class A
{
	mutable int a;
 
        public:
	int assign(int i) const {
		a = i;
	}
	int return_value() const {
		return a;
	}
 
};
 
int main(int argc, char const *argv[])
{
	A obj;
	obj.assign(5);
	cout<<obj.return_value();
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
34
What is the size of the heap?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
35
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
  string str ("helloworld.");
  cout << str.substr(3).substr(4) << endl;
  return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
36
What will be the output of the following C++ code?
#include <iostream> 
#include <string>
using namespace std; 
int main(int argc, char const *argv[])
{
	char str[] = "Hello World";
	cout<<str[0];
	return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
Pick the correct statement about string objects in C++.
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
38
Why we use the "dynamic_cast" type conversion?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
39
Which is used to return the number of characters in the string?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
40
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    int a = 0;
    int b = 10;
    if ( a && b )
    {
        cout << "true"<< endl ;
    }
    else
    {
         cout << "false"<< endl ;
    }
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board