Font size
WorksheetsC++
Total questions: 25
Worksheet time: 22mins
What is the only function all C++ programs must contain?
start()
system()
main()
program()
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
What punctuation is used to signal the beginning and end of code blocks?
{ }
-> and <-
BEGIN and END
( and )
When a class is derived from a base class it gets access to:
Private
Protected
Private and Protected
Protected and Public
Private, Protected and Public
In a class the access specifiers are _______ by default:
Private
Protected
Public
When a class becomes a friend of another class they are additionally getting access to:
Private
Protected
Public
None of the above
There can only be one catch block in a program
True
False
I only
II only
III only
I and II only
II and II only
When class B is inherited from class A, what is the order in which the destructors are called.
Class A first Class B next
Class B first Class A next
Class B's only as it is the child class
Class A's only as it is the parent class
The compiler creates an instance of a function template in memory as soon as it encounters the template.
True
False
There can only be one catch block in a program
True
False
Reg No in full
C programs are converted into machine language with the help of
An Editor
A compiler
An operating system
None of these.
The continue statment cannot be used with
for
while
do while
switch
In the following loop construct, which one is executed only once always.
for(exp1; exp2; exp3)
exp1
exp3
exp1 and exp3
exp1,exp2 and exp3
Choose a correct C do while syntax.
dowhile(condition) { //statements }
do while(condition) { //statements }
do { //statements }while(condition)
do { //statements }while(condition);
What is the way to suddenly come out of or Quit any Loop in C Language.?
continue; statement
break; statement
leave; statement
quit; statement
Loops in C Language are implemented using.?
While Block
For Block
Do While Block
All the above
Choose a right C Statement.
Loops or Repetition block executes a group of statements repeatedly.
Loop is usually executed as long as a condition is met.
Loops usually take advantage of Loop Counter
All the above.
Inside try
Exception Caught
After throw
After catch
Inside try
Exception Caught
After catch
Inside try
Exception Caught
Inside try
After throw
After catch
Compile Error
Inside Fun1()
Inside Fun2()
Inside Fun1() Inside Fun2()
Inside Fun2() Inside Fun1()
0
1
2
3
There are two count variables. Not enough info
