C++ Exam 2025

Created by admin

C++ Exam 2025

1 / 31

Which of these is not a fundamental data type in C++?

2 / 31

What is the difference between delete and delete[] in C++?

3 / 31

Which data type would be best to store a person's age?

4 / 31

What happens if the following program is executed in C and C++?

#include <stdio.h> 
int main(void) 
{ 
	int new = 5;
	printf("%d", new); 
}

5 / 31

Which of the following is used to terminate the function declaration in C++?

6 / 31

Which is more effective while calling the C++ functions?

7 / 31

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

  1.     #include <iostream>
        using namespace std;
        int main()
        {
            char c = 74;
            cout << c;
            return 0;
        }

8 / 31

Which of the following approach is used by C++?

9 / 31

What is abstract class in C++?

10 / 31

Who invented C++?

11 / 31

Which concept allows you to reuse the written code in C++?

12 / 31

What is the value of p in the following C++ code snippet?

  1.     #include <iostream>
        using namespace std;
        int main()
        {
            int p;
            bool a = true;
            bool b = false;
            int x = 10;
            int y = 5;
            p = ((x | y) + (a + b));
            cout << p;
            return 0;
        }

     

13 / 31

What will be the output of the following C++ code snippet?

  1.     #include <iostream>
        using namespace std;
        int operate (int a, int b)
        {
            return (a * b);
        }
        float operate (float a, float b)
        {
            return (a / b);
        }
        int main() 
       {
            int x = 5, y = 2;
            float n = 5.0, m = 2.0;
            cout << operate(x, y) <<"\t";
            cout << operate (n, m);
            return 0;
        }

14 / 31

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

#include<iostream>
using namespace std;
int main ()
{
   int cin;
   cin >> cin;
   cout << "cin: " << cin;
   return 0;
}

15 / 31

Which of the following correctly declares an array in C++?

16 / 31

Which of the following symbol is used to declare the preprocessor directives in C++?

17 / 31

Which of the following is a correct identifier in C++?

18 / 31

Which of the following is used for comments in C++?

19 / 31

Which of the following type is provided by C++ but not C?

20 / 31

What is a variable in C++?

21 / 31

The C++ code which causes abnormal termination/behaviour of a program should be written under _________ block.

22 / 31

What is the use of the indentation in c++?

23 / 31

What is meant by a polymorphism in C++?

24 / 31

What is Inheritance in C++?

25 / 31

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

  1.     #include <iostream>
        using namespace std;
        int main ()
        {
            int a, b, c;
            a = 2;
            b = 7;
            c = (a > b) ? a : b;
            cout << c;
            return 0;
        }

26 / 31

What is C++?

27 / 31

What is the benefit of c++ input and output over c input and output?

28 / 31

What happens if the following program is executed in C and C++?

#include <stdio.h> 
void func(void)
{
	printf("Hello");
}
void main() 
{ 
	func();
	func(2);
}

29 / 31

Which of the following constructors are provided by the C++ compiler if not defined in a class?

30 / 31

What distinguishes a class from an object in OOP?

31 / 31

Which of the following is the correct syntax of including a user defined header files in C++?

Scroll to Top