wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

9-Cpp-1

Total questions: 13

Worksheet time: 6mins

Name
Class
Date
1.

Which one indicates a single-line comment?

a)

**

b)

//

c)

##

d)

?

2.

Of the following, which one is a machine language?

a)

Assembly

b)

C++

c)

Pascal

d)

C#

3.

Comments are required in a program to add explanation about your code without compiling.

a)

True

b)

False

4.

What punctuation character signals the end of each statement?

a)

??

b)

**

c)

;

d)

\\

5.

What statement to you use to print something to the screen?

a)

cin

b)

cout

c)

if

d)

return

6.

What will the following statements print?


int i=5;

int j=7;


cout << i << " " << j ;

4 lines
7.

Of the following, which one is a valid variable name?

a)

return

b)

2020ichc

c)

ichc2_020

d)

ichb 2020

8.

All variables must be declared before they can be used.

a)

True

b)

False

9.

Which one is output operator?(cout)

a)

<<

b)

\\

c)

==

d)

&&

10.

Which of the following is correct in C ++ for main function?

a)

int main()

{


}

b)

int Main()

{


}

c)

int main

{


}

d)

int MAIN()

{


}

11.

Which of the following prompts the user to enter a price?

a)

cin >> "What is the price? ";

b)

cin << "What is the price? ";

c)

cout << "What is the price? ";

d)

cout >> "What is the price? ";

12.

Which of the following statements advances the cursor to the next line on the computer screen?

a)

cout << endl;

b)

cout << endline;

c)

cout << newline;

d)

cout << (\n);

13.

Which is the smallest unit of computer storage?

a)

Byte

b)

Bit

c)

Kilobyte

d)

Megabyte