wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

C++ 1st ONLINE QUIZ

Total questions: 13

Worksheet time: 7mins

Name
Class
Date
1.

What is a correct syntax to output "Hello World" in C++?

a)

Console.WriteLine("Hello World");

b)

print("Hello World);

c)

cout<<"Hello World");

d)

System.out.println("Hello World");

2.

C++ is an alias of C#

a)

TRUE

b)

FALSE

3.

How do you insert COMMENTS in C++ code?

a)

# This is a comment

b)

/*This is a comment

c)

//This is a comment

d)

/*/This is a comment

4.

Which data type is used to create a variable that should store text?

a)

String

b)

Char

c)

Int

d)

string

5.

How do you create a variable with the numeric value 5?

a)

int x = 5

b)

double x = 5

c)

num x = 5

d)

x = 5

6.

How do you create a variable with the floating number 2.8?

a)

double x = 2.8;

b)

int x = 2.8;

c)

byte x = 2.8

d)

x = 2.8

7.

Which header file lets us work with input and output objects?

a)

#include<stream>

b)

#include<iosstream>

c)

#include<inputstr>

d)

#include<iostream>

8.

Which operator can be used to compare two values?

a)

<>

b)

==

c)

><

d)

=

9.

How do you start writing an if statement in C++?

a)

if (x > y)

b)

if x > y

c)

if x > y then:

d)

if (x > y);

10.

To declare an character in C++, define the variable type with:

a)

( )

b)

[ ]

c)

{ }

d)

| |

11.

How many Logical Operators we have in C++?

a)

4

b)

6

c)

3

d)

5

12.

How many Arithmetic Operators we have in C++?

a)

5

b)

4

c)

6

d)

7

13.

How many Comparison Operators we have in C++?

a)

7

b)

8

c)

6

d)

9