Declaration and Initialization of Variables in C++

Declaration and Initialization of Variables in C++

University

10 Qs

quiz-placeholder

Similar activities

Java Quiz 1 in tamil theme

Java Quiz 1 in tamil theme

University

10 Qs

Repaso Segundo Parcial - AdC 2024 - K1031

Repaso Segundo Parcial - AdC 2024 - K1031

University

10 Qs

SOAL IE

SOAL IE

University

12 Qs

Intro to JS: Variables & Values

Intro to JS: Variables & Values

11th Grade - University

8 Qs

Quiz CG - Code V2

Quiz CG - Code V2

University

10 Qs

Quiz Pengetahuan Tipe Data

Quiz Pengetahuan Tipe Data

10th Grade - University

6 Qs

Quiz on Basics of C

Quiz on Basics of C

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?