Having multiple condition inside a loop
Duration: 14 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- About Course: About the Course
- English Language: Vocabulary, Noun, Adjectives, Tenses, Pronoun, Adverb, Preposition, Conjunction, Active Passive Voice (Voice), Articles, Direct and Indirect Speech, Sentence Correction (Error Correction), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Completion (Fill in the blanks), Cloze Test (Cloze Passage)
- Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Puzzle Solving (Puzzles), Seating Arrangements, Blood Relations, Syllogisms, Inequality, Directions (Direction Test), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Clock, Calendar, Analytical Reasoning (Counting Figures Reasoning), Selection Decision Table (Decision Making), Cubes & Dices, Machine Input-Output
- Quantitative Aptitude: Ratio and Proportion (Ratios), Data Interpretation, Mixture and Alligation, Permutation and Combination, Number System, Sequence and Series (Series), Speed Time and Distance, Algebra, Speed Mathematics and Basic Mathematics, Percentage, Average, Time and Work, Simple Interest and Compound Interest, Profit and Loss, Age Problems, Partnership, Mensuration and Geometry, Probability, IBPS Specific Videos
- Data Structures - Professional Knowledge: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- Algorithms- Professional Knowledge: Algorithm Analysis, Time Complexity Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos
- Python- Professional Knowledge: Python for Placements by Yash Sir, Python Basics
- Operating System- Professional Knowledge: Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management
- DBMS + SQL- Professional Knowledge: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), File Organization & Indexing, SQL, Transaction Management, Concurrency Control
- Computer Networks- Professional Knowledge: Introduction to CN, Data Communication, Net Layer: IP Addressing, Net Layer: IPv4 & Proto, Application Layer, Hardware basics, Network Security
- Software Engineering- Professional Knowledge: Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
- Computer Organization & Microprocessor- Professional Knowledge: Basics of COA, Cache Memory Organization, Programming the Basic Computer
- Digital Logic Design- Professional Knowledge: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation
- Theory of Computation- Professional Knowledge: Introduction to TOC, Deterministic FA (DFA), Non-Deterministic FA, Regular Expressions, Regular Language Properties, Pushdown Automata & CFG, Turing Machines
- Compiler Design- Professional Knowledge: Intro to Compilers, Lexical Analysis, Grammar & CFG, Syntax Analysis: Top-Down, Intermediate Code Gen, Code Optimization
- Programming Languages- Professional Knowledge: C Programming by Yash Sir, Object Oriented Programming (OOPS), Programming in C++, Java, C Language Core
- Emerging Tech- Professional Knowledge: Emerging Tech Trends
- Artificial Intelligence: Artificial Intelligence
- Unit Test - Professional Knowledge:
- Full Length Mock Test:
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This educational video is a lecture on C programming, specifically focusing on multiple-choice questions (MCQs) related to loops, which are a common topic in competitive exams like GATE and TCS NQT. The instructor, Yash Jain, begins with an introduction to the topic, followed by a detailed analysis of a C code snippet that uses a 'for' loop with a 'double' variable. He explains that due to floating-point precision issues, the loop condition `k < 3.0` may never become false, leading to an infinite loop, which is the correct answer. The video then transitions to another MCQ involving a 'while' loop with a comma operator in the condition, which is syntactically incorrect. The instructor demonstrates that the comma operator evaluates to the last expression, making the condition `j < 10`, but the syntax of the 'while' loop is invalid because it lacks a proper condition. The final segment shows a third MCQ from TCS NQT 2019, where the instructor analyzes a 'while' loop with a comma operator in the condition, correctly identifying it as a syntax error. The video uses a digital blackboard for code and explanations, with the instructor providing a clear, step-by-step walkthrough of each problem.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with a title slide for a C programming MCQs lecture by Yash Jain. The slide features a glowing blue keyboard and a small diagram of a presentation screen. The instructor then transitions to a new slide with a large golden 'C' and a laptop displaying 'Loops in C'. The main content area shows a C code snippet with a 'for' loop using a 'double' variable 'k'. The instructor begins to analyze the code, pointing out the loop condition `k < 3.0` and the increment `k++`. He explains that the loop will run infinitely because of floating-point precision issues, where the value of 'k' may never exactly reach 3.0, making the condition always true. The options for the MCQ are listed below the code.
2:00 – 5:00 02:00-05:00
The instructor continues to analyze the first MCQ. He writes on the digital blackboard, explaining the loop's behavior. He notes that the loop starts with `k = 0.0` and increments by 1.0 each time. He demonstrates that the loop will run for `k = 0.0, 1.0, 2.0`, but when `k` becomes `3.0`, the condition `k < 3.0` is false, so the loop should terminate. However, he points out that due to floating-point representation, `k` might be `2.999999` or `3.000001`, which could cause the loop to run one more time or never terminate. He concludes that the loop will run infinitely, making option (b) the correct answer. He then moves to the next MCQ, which involves a 'while' loop with a comma operator in the condition.
5:00 – 10:00 05:00-10:00
The instructor analyzes the second MCQ, which contains a 'while' loop with the condition `i<5,j<10`. He explains that the comma operator evaluates the left expression, then the right, and returns the value of the right expression. Therefore, the condition becomes `j<10`. However, he points out that the syntax of the 'while' loop is incorrect because the condition is not properly enclosed in parentheses. He writes on the board, showing that the correct syntax should be `while (i<5, j<10)`. He concludes that this is a syntax error, making option (a) the correct answer. He then moves to the third MCQ, which is from TCS NQT 2019.
10:00 – 14:09 10:00-14:09
The instructor presents the third MCQ, which is from TCS NQT 2019. The code shows a 'while' loop with the condition `i=5,j<10`. He explains that the comma operator evaluates the left expression `i=5` (which assigns 5 to i) and then the right expression `j<10`, returning the value of the right expression. However, he points out that the syntax is incorrect because the condition is not properly enclosed in parentheses. He writes on the board, showing that the correct syntax should be `while (i=5, j<10)`. He concludes that this is a syntax error, making option (a) the correct answer. The video ends with the instructor summarizing the key points and encouraging students to practice more MCQs.
The video provides a comprehensive analysis of C programming MCQs related to loops, focusing on common pitfalls and syntax errors. The instructor systematically breaks down each problem, using a digital blackboard to illustrate the logic and code execution. The key learning points are the importance of understanding floating-point precision in loop conditions and the correct syntax for using the comma operator within control structures. The progression from a conceptual problem (infinite loop due to precision) to a syntactic problem (incorrect loop condition) effectively demonstrates the range of issues students might encounter in competitive exams.

