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 use of polar function?

2. Which of the following is corect way of constructing bitset using integer number?

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

#include <iostream>
#include <complex>
using namespace std;
int main()
{
	complex <double> cn(3.0, 4.0);
	cout<<"Norm is: "<<norm(cn)<<endl;
	return 0;
}

4. What is the use of is_same() function in C++?

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

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

6. What is the use of sum() function in Valarray?

7. What is bitset in C++?

8. Which of the following relationships is uni-directional?

9. What happens if a pair is not initialized?

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

#include <iostream>
#include <bitset>
using namespace std;
int main()
{
	bitset<8> b1(95);
	bitset<8> b2(45);
	cout<<~b1<<endl;
	cout<<(b1|b2)<<endl;
	cout<<(b1&b2)<<endl;
}

 

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.