What are the basic data types in C++?

C++ Concepts Mastery

Quiz
•
Others
•
University
•
Hard
Suganthi Vishnu
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
int, float, string, long, short
char, double, void, long, short
int, float, double, char, bool
string, array, void, long, short
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Explain the difference between while and do-while loop in C++.
The while loop and do-while loop are the same and can be used interchangeably
The while loop checks the condition before executing the code inside the loop, while the do-while loop executes the code inside the loop at least once before checking the condition.
The while loop executes the code inside the loop at least once before checking the condition
The do-while loop checks the condition before executing the code inside the loop
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the scope of a variable declared inside a function in C++?
Limited to the function in which it is declared
Accessible from any function in the program
Limited to the block in which it is declared
Accessible only from the main function
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you open a file in C++ for writing?
ofstream myfile("example.txt");
openfile myfile('example.txt');
ofstream myfile = open('example.txt');
writefile myfile('example.txt');
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'return' statement in a function in C++?
To pause the execution of the function
To exit the function and return a value to the calling code.
To print a message to the console
To skip the rest of the code in the function
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax for declaring a multi-dimensional array in C++?
arrayName[size1, size2, ..., sizeN] = dataType;
arrayName[size1][size2]...[sizeN];
dataType arrayName[size1][size2]...[sizeN];
dataType arrayName[size1, size2, ..., sizeN];
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you read data from a file in C++?
Using the cin object to read from the file
Using the ifstream class and its member functions
Using the ofstream class and its member functions
Using the fstream class and its member functions
Create a free account and access millions of resources
Similar Resources on Quizizz
15 questions
C++ Syntax and Concepts Quiz

Quiz
•
University
10 questions
Basal Ganglia Quiz

Quiz
•
University
7 questions
Continuous Assessment in Human Physiology

Quiz
•
University
11 questions
C Programming Challenge

Quiz
•
University
15 questions
Exploring Functions and Graphs

Quiz
•
University
10 questions
Quiz on Applied Mathematics II set by walle T.

Quiz
•
University
15 questions
Midterm Examination 1.2 (Computer Network)

Quiz
•
University
10 questions
monthly test of feb 25

Quiz
•
University
Popular Resources on Quizizz
15 questions
Character Analysis

Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing

Quiz
•
9th - 12th Grade
10 questions
American Flag

Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
30 questions
Linear Inequalities

Quiz
•
9th - 12th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25

Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers

Quiz
•
6th - 8th Grade