
Unit -2 Control Statements and Sorting Algorithms

Quiz
•
Computers
•
University
•
Medium
Shubham Khari
Used 2+ times
FREE Resource
50 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is NOT a control statement in C/C++?
if-else
switch
for
class
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the main purpose of a loop invariant?
To ensure faster execution
To prove correctness of a loop
To reduce memory usage
To determine loop termination condition
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A loop invariant must hold:
Only before the loop starts
Before and after every iteration
Only after the loop ends
Randomly during execution
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Loop invariants are mainly used in:
Compiler optimization
Algorithm correctness proofs
Data compression
File handling
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If a while loop runs n times, proving correctness requires:
Base case, inductive step
Just loop termination
Big-O analysis
Deadlock freedom
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The "termination condition" in a loop guarantees:
No segmentation fault
Loop eventually ends
Algorithm is stable
Minimum space complexity
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a variant function used in correctness proofs?
A function that strictly decreases with each iteration
A function that increases arbitrarily
A constant function
A random number generator
Create a free account and access millions of resources
Similar Resources on Wayground
46 questions
Ôn tập

Quiz
•
10th Grade - University
50 questions
CSC 105 Data Structures and Algorithms Midterm Exam

Quiz
•
University
50 questions
Data Structures and Algorithms Quiz

Quiz
•
University
50 questions
KLA Quiz Struktur Data UAS

Quiz
•
University
45 questions
Event Driven Handouts 1 & 2

Quiz
•
University
50 questions
Data Structures Quiz

Quiz
•
University
50 questions
Quiz Informatika 1

Quiz
•
11th Grade - University
50 questions
M3 50Q

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
10 questions
Would you rather...

Quiz
•
KG - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
10 questions
The Constitution, the Articles, and Federalism Crash Course US History

Interactive video
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
16 questions
Water Modeling Activity

Lesson
•
11th Grade - University
10 questions
ACT English prep

Quiz
•
9th Grade - University