Declaration and Initialization of Variables in C++

Declaration and Initialization of Variables in C++

University

10 Qs

quiz-placeholder

Similar activities

Uji Pemahaman Basis Data

Uji Pemahaman Basis Data

University

13 Qs

Modul 7 2025 Quizy Eazy Peazy

Modul 7 2025 Quizy Eazy Peazy

University

12 Qs

Understanding Digital Information Quiz

Understanding Digital Information Quiz

University

10 Qs

CMDP2060 - Programming Design and Implementation (W01 - W03)

CMDP2060 - Programming Design and Implementation (W01 - W03)

University

15 Qs

Session 02: Variable - Data types - Operators

Session 02: Variable - Data types - Operators

University

14 Qs

Session 15 + 16 : Function

Session 15 + 16 : Function

University

13 Qs

C Programming Quiz

C Programming Quiz

University

10 Qs

Типы данных. Переменные. Операции в Java

Типы данных. Переменные. Операции в Java

University

10 Qs

Declaration and Initialization of Variables in C++

Declaration and Initialization of Variables in C++

Assessment

Quiz

Information Technology (IT)

University

Medium

Created by

Fatma Metwally

Used 2+ times

FREE Resource

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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?