My Report

C++ Programming Practice Test 8


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement

1. What is the full form of vtable?

2. Elements in STL heap are removed in ________________________

3. What will be the output of the following C++ code?

#include <iostream>
#include <string>
using namespace std;
int main()
{
	cout<<rank<remove_extent<string[10][20]>::type>::value;
	cout<<rank<remove_extent<string[10][20][30]>::type>::value;
	return 0;
}

4. What will be the output of the following C++ code?

#include <iostream>
#include<type_traits>
using namespace std;
class Base
{
    public:
};
int main()
{
	Base b;
	cout<<sizeof(b);
	return 0;
}

5. What will be the output of the following C++ code?

#include <iostream>
#include <string>
using namespace std;
int main()
{
	cout<<extent<string[10][20][30], 0>::value;
	cout<<extent<string[10][20][30], 1>::value;
	cout<<extent<string[10][20][30], 2>::value;
	return 0;
}

6. What is vtable in C++?

7. What does size() function returns?

8. Which header file is used for generating random numbers?

9. Which function is used to get the real part of the complex number?

10. What will be the output of the following C++ code?

#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
	tuple <int, char, string> tp;
	tp = make_tuple(4, '1', "Hello");
	return 0;
}

 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.