
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
What are the basic data types in C++?
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 Wayground
15 questions
Understanding Python Control Structures

Quiz
•
University
8 questions
physiotherapy Orientation

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

Quiz
•
University
5 questions
Understanding Cell Structure

Quiz
•
9th Grade - University
15 questions
Anaphysio Chapter 1

Quiz
•
University
15 questions
Cell and Molecular Biology Quiz

Quiz
•
University
9 questions
ECE 294 - Analog and Digital Lab Quiz

Quiz
•
University
10 questions
Algebraic Skills Assessment

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Others
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University