ExamVeda
Login
Home
1
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    typedef int num;
    num a = 10, b = 15;
    num c = a + b + a - b;
    cout << c;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
2
Pick out the correct syntax of operator conversion.
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
3
What are the essential operators in c++?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
4
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
class B
{
	int b;
   public:
	B(int i){
		b = i;
	}
};
 
class C
{
	B b;
    public:
	C(int i){
		b = B(i);
	}
	friend void show();
};
 
void show()
{
	C c(10);
	cout<<"value of b is: "<<c.b.b<<endl;
}
 
int main(int argc, char const *argv[])
{
	show();
	return 0;
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
5
What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
    string str ("nobody does like this");
    string key ("nobody");
    size_t f;
    f = str.rfind(key);
    if (f != string::npos)
        str.replace (f, key.length(), "everybody");
    cout << str << endl;
    return 0;
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
6
What is the correct syntax of accessing a static member of a Class?
---------------------------
Example class:
class A
{
	public:
		static int value;
}
---------------------------
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
7
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
class myclass
{
    public:
    int i;
    myclass *operator->()
    {return this;}
};
int main()
{
    myclass ob;
    ob->i = 10; 
    cout << ob.i << " " << ob->i;
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
8
What is the syntax of user-defined data types?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
9
Which is used to pass the large objects in c++?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
10
How to stop your program from eating so much ram?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board