stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
DSA Quiz Flashcards | StudBud
Explore
/
DSA Quiz
DSA Quiz
13 terms
·
StudBud Administration
·
20 plays
solve all polls mandatory
Flashcards
13 cards
F
Practice quiz
P
Host live
L
Questions
13
Answers
1
Which operation removes an element from the stack?
Push
Pop
Peek
Insert
2
What is the purpose of the return 0; statement in the main() function?
It exits the program without any result
It prints "0" to the console
It indicates that the program ended successfully
It marks the start of the program
3
Which of the following C++ features is used to implement the stack in the provided code?
Functions only
Arrays
Pointers
Classes
4
Which of the following functions is used to read user input in C++?
cin
output ()
read ()
print ()
5
What does LIFO stand for?
Last In, Last Out
Last In, First Out
First In, First Out
First In, Last Out
6
What happens if we push an element into a full stack?
Nothing
Underflow
Overflow
Segmentation Fault
7
What is the purpose of the #include directive in C++?
To handle file operations
To define classes
To include input/output stream functions like cin and cout
To declare variables
8
In C++, what type of operator is ==?
Assignment operator
Arithmetic operator
Increment operator
Equality operator
9
What is the data type of arr in the given code?
float
char
int
string
10
What is the purpose of #include in C++?
It is used for defining variables
It allows the use of string objects and functions
It manages memory allocation
It handles mathematical operations
11
Which of the following is NOT an application of stacks?
Function call execution
CPU scheduling
Web browser history
Undo/Redo in text editors
12
In C++, what is the purpose of a constructor in a class?
It is used to perform arithmetic operations
It initializes objects of the class
It is called when an object is created
It is used to destroy objects
13
What is the default value of top in the Stack class?
0
1
-1
5