
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
50 questions
MS Excel Quiz

Quiz
•
University
50 questions
Quiz

Quiz
•
University
51 questions
Data Structures and Algorithm - Final Examinations Quiz

Quiz
•
University
45 questions
CPSC 131 midterm review

Quiz
•
University
51 questions
Quiz JavaScript

Quiz
•
University
50 questions
Computer Systems and Algorithms Quiz

Quiz
•
10th Grade - University
54 questions
Ôn Tập CUỐI KÌ I Tin 8

Quiz
•
8th Grade - University
50 questions
UAS GANJIL INFORMATIKA X

Quiz
•
10th Grade - 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 Computers
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