
Unit -2 Control Statements and Sorting Algorithms
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Shubham Khari
Used 2+ times
FREE Resource
Enhance your content in a minute
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
50 questions
DS-UNIT-2-Stack Queue
Quiz
•
University
50 questions
Test Mendix 1
Quiz
•
University
45 questions
Python Quiz
Quiz
•
University
50 questions
Excel
Quiz
•
University
45 questions
Culture générale en informatique
Quiz
•
University
50 questions
Fundamental of OS - Revision 2
Quiz
•
University
50 questions
Introduction to Data Communication 2
Quiz
•
University
45 questions
Quiz-PTS2-TIK Gr4
Quiz
•
4th Grade - University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
