C++ Quiz (2) Test your knowledge of the C++ programming language with this quiz. See if you can answer all 12 questions correctly rihanna80 published on February 11 Stacked 1/12 What is the correct syntax to declare a variable in C++? int x; variable x; x = int; x = variable; 2/12 Which keyword is used to define a function in C++? func def void function 3/12 How do you print 'Hello, World!' using C++? console.log('Hello, World!'); cout << 'Hello, World!' << endl; System.out.println('Hello, World!'); print('Hello, World!'); 4/12 Which data type is used for storing a single character in C++? boolean int char string 5/12 What is the output of the following code?int x = 5;cout << x++ << endl; 5 6 Compiler Error 6/12 Which operator is used for memory allocation in C++? new memalloc malloc both new and malloc 7/12 Which loop is guaranteed to run at least once? do-while for while if 8/12 What is the size of 'int' data type in C++? 4 bytes platform-dependent 8 bytes 2 bytes 9/12 Which keyword is used to inherit a class in C++? extends inherits implements class 10/12 What does the '++' operator do in C++? Subtraction Multiplication Increment Assignment 11/12 Which header file is needed to use input/output functions in C++? <iostream> <stdio.h> <stdlib.h> <fstream> 12/12 Which operator is used for accessing the member of a class in C++? -> :: . >>