My Report

C++ Basic Online Test – 2


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 size of a boolean variable in C++?

2. What will be the output of the following program in both C and C++?

#include<stdio.h>
int main(int argc, char const *argv[])
{
	printf("%d\n", (int)sizeof('a'));
	return 0;
}

3. Which of the following is an entry-controlled loop?

4. What is static binding?

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

#include<stdio.h>
int main(int argc, char const *argv[])
{
	char a = 'a';
	printf("%d\n", (int)sizeof(a));
	return 0;
}

6. What is name mangling in C++?

7. Which of the following is not a fundamental type is not present in C but present in C++?

8. Which of the following is an exit-controlled loop?

9. In which part of the for loop termination condition is checked?
for(I;II;III)
{IV}

10. Which of the following is C++ equivalent for scanf()?

11. What if we define the below structure in C and C++?

12. Which of the following is the correct difference between cin and scanf()?

13. Which of the following is C++ equivalent for printf()?

14. What is dynamic binding?

15. Which of the following syntax for declaring a variable of struct STRUCT can be used in both C and C++?


 

Start practicing “1000 MCQs on C++”, and once you are ready, you can take tests on all topics by attempting our “C++ Test Series”.

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.