Welcome to your C++ Level 1

You have to complete this quiz of 30 questions.
After successful submission, you will receive the results at your registered email address below. For further queries, you can contact us through our Contact Us Page.

Thank you.

1. 
Which of the following user-defined header file extension used in c++?

2. 
By default, all the files in C++ are opened in _________ mode.

3. 
Who invented C++?

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

  1.     #include
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         char c = 74;
  6.         cout << c;
  7.         return 0;
  8.     }

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

  1.     #include
  2.     using namespace std;
  3.     int main()
  4.     {
  5.         int p;
  6.         bool a = true;
  7.         bool b = false;
  8.         int x = 10;
  9.         int y = 5;
  10.         p = ((x | y) + (a + b));
  11.         cout << p;
  12.         return 0;
  13.     }

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

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

8. 
What is the size of wchar_t in C++?

9. 
What happens if the following C++ statement is compiled and executed?

int *ptr = NULL;
delete ptr;

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

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

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

#include

using namespace std;

int main ()

{

   int cin;

   cin >> cin;

   cout << "cin: " << cin;

   return 0;

}

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

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

#include
#include
using namespace std;

int main(int argc, char const *argv[])

{

              char s1[6] = "Hello";

              char s2[6] = "World";

              char s3[12] = s1 + " " + s2;

              cout<<s3;

              return 0;

}

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

16. 
Which of the following is correct about this pointer in C++?

17. 
Which of the following C++ code will give error on compilation?

================code 1=================

#include

using namespace std;

int main(int argc, char const *argv[])

{

              cout<<"Hello World";

              return 0;

}

========================================

================code 2=================

#include

int main(int argc, char const *argv[])

{

              std::cout<<"Hello World";

              return 0;

}

========================================

18. 
What is C++?

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

#include

void func(void)

{

              printf("Hello");

}

void main()

{

              func();

              func(2);

}

20. 
What will be the output of the following C++ function?

  1.     int main()
  2.     {
  3.         register int i = 1;
  4.         int *ptr = &i;
  5.         cout << *ptr;
  6.               return 0;
  7.     }

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

22. 
What will be the output of the following C++ program?

  1.     #include
  2.     #include
  3.     using namespace std;
  4.     int main()
  5.     {
  6.         cout << setprecision(17);
  7.         double d = 0.1;
  8.         cout << d << endl;
  9.         return 0;
  10.     }

23. 
Which of the following is not a type of Constructor in C++?

24. 
What is virtual inheritance in C++?

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

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

  1.     #include
  2.     #include
  3.     #include
  4.     using namespace std;
  5.     int main()
  6.     {
  7.         string s = "spaces in text";
  8.         s.erase(remove(s.begin(), s.end(), ' ' ), s.end() ) ;
  9.         cout << s << endl;
  10.     }

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

#include

int main(void)

{
              int new = 5;
              printf("%d", new);
}

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

29. 
What will be the output of the following C++ program?

#include

#include

#include

using namespace std;

int main(int argc, char const *argv[])

{

              const char *a = "Hello\0World";

              cout<<a;

              return 0;

}