Search Header Logo

C++ Pre-Test

Authored by AMBILI S

Computers

University

Used 1+ times

C++ Pre-Test
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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


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

print ("Hello World");

cout << "Hello World";

Console.WriteLine("Hello World");

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is C++?

a) C++ is an object oriented programming language

b) C++ is a procedural programming language

c) C++ supports both procedural and object oriented programming language

d) C++ is a functional programming language

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used for comments in C++?

a) /* comment /

b) // comment /

c) // comment

d) both // comment or /* comment */

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct identifier in C++?

a) VAR_1234

b) $var_name

c) 7VARNAME

d) 7var_name

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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


x = 5;

double x = 5;

num x = 5

int x = 5;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if the following program is executed in C and C++?

#include <stdio.h> int main(void) { int new = 5; printf("%d", new); }

a) Error in C and successful execution in C++

b) Error in both C and C++

c) Error in C++ and successful execution in C

d) A successful run in both C and C++

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following type is provided by C++ but not C?

a) double

b) float

c) int

d) bool

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers