NEW
Font size
WorksheetsPLD_FinalsSAT Quiz
Total questions: 25
Worksheet time: 25mins
Choose a correct C++ do while syntax.
dowhile(condition) { //statements }
do while(condition) { //statements }
do { //statements }while(condition)
do { //statements }while(condition);
In the following loop construct, which one is executed only once always.
for(statement1; statement2; statement3)
statement1
statement3
statement1 and statement3
statement1,statement2 and statement3
Who is Father of C++ Language
Bjarne Stroustrup
James A. Gosling
Dennis Ritchie
Dr. E.F. Codd
Which of the following is a correct comment?
*/ Comments */
** Comment **
/* Comment */
{ Comment }
Declaration statement for an array named arr with size 4 is
int arr[0];
int arr[5];
int arr(4);
int arr[4];
All keywords in C++ are in ____________
Lowercase
Uppercase
Camelcase
None of these
Every C++ Program Statement must be terminated with a
.
#
;
!
How many choices are possible when using a single if-else statement?
1
2
3
4
What will the result of 'num' variable after execution of the following statements?
int num = 58;
num % = 11;
3
5
8
11
What output is produced by the following segment of code:
for(int i = 0; i < 10; i++)
cout << i << " ";
0 1 2 3 4 5 6 7 8 9 10
0 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9
Infinite Loop
True/False: For Loops can never be an infinite loop.
True
False
How many times will the shown for loop execute?
0
9
10
11
What is the only function all C++ programs must contain?
cout()
system()
main()
program()
What is the return type of this function?
a * b
int
void
(int a, int b)
True or false: a function can have an empty parameter list
True
False
True or false: functions can call other functions
True
False
What is the output of the following code snippet?
int x = 5;
int y = 10;
int z = x + y;
cout << z << endl;
15
510
5+10
error
Which keyword is used to define a constant in C++?
constant
const
final
immutable
What is the output of the following code snippet?
int a = 10;
int b = 20;
int c = a * b;
cout << c << endl;
200
30
1020
error
What is the output of the following code snippet?
int x = 8;
int y = 4;
int z = x / y;
cout << z << endl;
2
12
4
error
Who developed the C++ programming language?
Ken Thompson
Bjarne Stroustrup
Linus Torvalds
Tim Berners-Lee
What is the correct syntax for a C++ while loop?
while(condition) { //statements }
while { //statements } (condition)
{ //statements } while(condition)
while(condition) { //statements }
