NEW
Font size
WorksheetsDiagnostico sobre C++ Noveno
Total questions: 10
Worksheet time: 5mins
What is the default file extension for a C++ program?
.c
.cpp
.java
.py
What keyword is used to define a constant in C++?
define
const
constant
let
Which of the following options prints "Hello, World!" in C++?
print("Hello, World!");
cout << "Hello, World!";
Console.WriteLine("Hello, World!");
System.out.println("Hello, World!");
¿Cuál de los siguientes encabezados es necesario para usar cout y cin en C++?
Which of the following options correctly defines an integer variable called numero with the value 10?
int numero = 10;
numero = 10;
int 10 = numero;
var numero = 10;
What operator is used to obtain the remainder of a division in C++?
/
*
%
^
What is the result of the following expression in C++? int x = 5; x++; cout << x;
4
5
6
Error
Which of the following options correctly represents a conditional structure in C++?
if x > 10 { cout << "Greater"; }
if (x > 10) { cout << "Greater"; }
if x > 10: cout << "Greater";
if x > 10 then cout << "Greater";
What loop is used when the number of times the block of code will be executed is not known in advance?
for
while
switch
do-while
Which of the following options is correct for declaring a function in C++ that returns an integer?
void myFunction();
int myFunction() { return 0; }
myFunction() -> int { return 0; }
function int myFunction() { return 0; }
