WorksheetsC++ quiz
Total questions: 15
Worksheet time: 8mins
Who invinted C++?
Dennis Ritchie
Ken Thompson
Brian Kernighan
Bjarne Stroustrup
Which of the following type is provided by C++ but not C?
double
float
int
bool
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"Hello world";
getch();
}
What would be the output for the above program?
Hello World
hello world
Hello world
HELLO WORLD
Which of the following is used to terminate the function declaration in C++?
;
]
)
:
Which of the following is used for comments in C++?
// comment
/* comment */
both // comment or /* comment */
// comment */
What are the actual parameters in C++?
Parameters with which functions are called
Parameters which are used in the definition of a function
Variables other than passed parameters in a function
Variables that are never used in the function
Which of the following is called insertion/put to operator?
<<
>>
>
<
Identify the correct extension of the user-defined header file in C++.
.cpp
.hg
.h
.hf
Which of the following loops is best when we know the number of iterations?
while loop
do while
for loop
all of the above
Identify the scope resolution operator.
!
::
?
none
By which of the following can the if-else statement be replaced?
Bitwise operator
Logical operator
Conditional operator
Arithmetic operator
Identify the correct function from which the execution of C++ program starts?
new()
start()
pow()
main()
Identify the size of int datatype in C++.
1 byte
2 bytes
4 bytes
Depends on compiler
Identify the logical AND operator.
||
&&
&
!
Data members and member functions of a class are private by.default. True or False?
true
false
depends on code
none
