NEW
Font size
WorksheetsMARATHON C++ - SEASON1
Total questions: 22
Worksheet time: 11mins
C++ is an alias of C#
False
True
What is a correct syntax to output "Hello World" in C++?
cout << "Hello World";
print ("Hello World");
System.out.println("Hello World");
cout << "Hello World"
Which data type is used to create a variable that should store text?
Txt
string
myString
String
How do you create a function in C++?
Data type functionName() ;
Data type functionName[] ;
(functionName)
functionName.
How do you call a function in C++?
functionName();
functionName[];
(functionName);
functionName;
How do you create a reference variable of an existing variable?
With the REF word
With the ref word
With the ref word With the * operator
With the & operator
Which method can be used to find the length of a string?
getSize()
len()
length()
getLength()
.Which operator is used to add together two values?
The + sign
The & sign
The * sign
The value of a string variable can be surrounded by single quotes.
True
False
Why is a class useful in programming?
are removed from memory when not in use
bring together all aspects of an entity in one place.
can closely model objects in the real world.
permit data to be hidden from other classes.
Which of the following keywords can’t appear inside a class definition?
friend
virtual
static
template
Which of the following statements is true about inline functions?
It's a compulsion on the compiler to make a function inline
It's a request to the compiler to make the function inline
It's the indication to the compiler that the function is recursive
It's the indication to the compiler that the function is a member function
Inline functions are avoided when
function contains static variables
function have recursive calls
function have loops
all of the mentioned
What is the user-defined header file extension in c++?
cpp
h
hg
hf
Which of the following keyword is used to declare the header file?
include
exclude
string
namespace
What is the syntax of class template?
template <parmaters> class declaration
Template <parmaters> class declaration
temp <parmaters> class declaration
Temp <parmaters> class declaration
C++ is
procedural programming language
object oriented programming language
functional programming language
both procedural and object oriented programming language
Which of the following will not return a value?
null
void
empty
If the user did not supply the value, what value will it take?
default value
both default value & rise an error
rise an error
error
Which of the following permits function overloading on c++?
type
number of arguments
type & number of arguments
number of objects
Output of following program?
Compiler Error
c
Garbage Value
b
is the following piece of code manifest overloading?
True
False
