Search Header Logo

Declaration and Initialization of Variables in C++

Authored by Fatma Metwally

Information Technology (IT)

University

Used 2+ times

Declaration and Initialization of Variables in C++
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following are valid C++ data types?

decimal, bool, char, text

float, string, char, integer

number, int, character, void

d) int, double, bool, void

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for declaring a variable named age of type int and initializing it to 25?

age int = 25;

var age = 25;

a) int age = 25;

int age : 25;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types is used to represent characters in C++?

byte

double

boolean

c) char

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of an int data type in bytes ?

  • 1 byte

  • 2 bytes

  • 4 bytes

  • 8 bytes

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the size of a char data type in bytes on most systems?

1 byte

  • 2 bytes

  • 4 bytes

  • 8 bytes

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types has the smallest size in bytes?

int

  • float

  • double

  • char

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types has the largest size in bytes?

  • int

  • double

  • float

char

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?