NEW
Font size
WorksheetsPRETEST CP1 2.1
Total questions: 30
Worksheet time: 15mins
C++ was developed by __________.
Charles
Bjarne Stroustrup
Pascal
Dennis
C++ is a ________ language.
Office-oriented procedure
Office-oriented programming
Object-oriented procedure
Object-oriented programming
________ are the smallest individual units of a program and their meaning and usage unchanged.
Tokens
Information
Data
Letter
Which of the following are the C++ tokens?
Variables
Operators
Keywords
All
Keywords are also called as ________.
Reserved words
Same words
Individual words
Special words
________ are names given to different entries such as variables, structures, and functions.
Keywords
Constants
Identifiers
Operators
______ are like a variable, except that their value never changes during execution once defined.
Operators
Variables
Keywords
Constants
A ______ is a meaningful name of data storage location in computer memory.
constant
keyword
operator
variable
C++ ______ is a symbol that is used to perform mathematical or logical manipulations.
operator
variable
constant
keyword
Which symbols are called as arithmetic operators?
< > <= >= == !=
&& || !
+ - * / %
=+ =- =* =/ =%
In Object-Oriented Programming (OOP), what is a class primarily known as?
A blueprint or template for creating objects
A variable declaration
A runtime object
A method or function
Which keyword is used to create a new instance of a class?
make
new
instantiate
answer
What keyword is used when declaring a method that belongs to the class itself, rather than to an instance of the class?
public
instance
this
static
When defining a method, what part specifies the type of value the method will return?
The parameter list
The return type
The method body
The method name
In a switch statement, which case acts as a catch-all for values that do not match any explicit case?
default
catch
else
if-else
Which loop is typically best suited for iterating over elements in a collection (like an array) without needing to manage an explicit index variable?
do-while
while
foreach
for
What keyword is used to exit a loop or a switch statement immediately?
exit
return
continue
break
Which loop is guaranteed to execute its body at least once?
do-while
foreach
while
for
Which statement is used for making a decision based on a Boolean condition?
try-catch
if-else
switch
while
Which logical operator represents the 'OR' condition?
&&
||
!
&!
What is the compound assignment operator to add 5 to a variable x?
x += 5;
x =+ 5;
x + 5;
x = x + 5;
Which operator is used for checking if two values are not equal?
<>
!=
==
!==
What is the modulus operator in C#, used to find the remainder of a division?
/
%
^
**
Which of the following is a reference type in C#?
double
struct
Array
enum
What is the term for converting a value type to a reference type (e.g., int to object)?
Parsing
Casting
Boxing
Unboxing
Which keyword is used for implicitly typed local variables, allowing the compiler to deduce the type from the initialization expression?
var
type
auto
let
What is the default size for a standard int type in C#?
32 bits
16 bits
8 bits
64 bits
In C#, which data type is used to store a sequence of characters?
Text
string
char[]
long
Which keyword is used for declaring a variable that can store whole numbers?
char
int
bool
float
Which of the following is a value type in C#?
string
class
int
Array
