Declaration and Initialization of Variables in C++

Declaration and Initialization of Variables in C++

University

10 Qs

quiz-placeholder

Similar activities

Chapter 3 : SQL Command

Chapter 3 : SQL Command

University

15 Qs

Session1

Session1

University

15 Qs

PSC - Vetores

PSC - Vetores

University

15 Qs

Introduction & Basic Program Structure

Introduction & Basic Program Structure

University

10 Qs

DSA-Quiz1-Pointers

DSA-Quiz1-Pointers

University

10 Qs

Tipe Data dan Fungsi dalam C

Tipe Data dan Fungsi dalam C

12th Grade - University

15 Qs

C Programming Fundamentals Quiz

C Programming Fundamentals Quiz

University

15 Qs

Fundametal DS Training 2025 - Day 2

Fundametal DS Training 2025 - Day 2

University

8 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?