Find LCM of 2 Numbers
Duration: 4 min
This video lesson is available to enrolled students.
Inside: a video lesson and guided study material.
Module outline
- Communication Round: Vocabulary, Subject Verb Agreement (Verb Noun Agreement), Tenses, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Direct and Indirect Speech, Active Passive Voice (Voice), Verbal Analogy (Word Based Analogy), Articles, Preposition, Conjunction, Sentence Construction, English Writing Ability, Communication Assessment
- Quantitative Aptitude: Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Speed Time and Distance, Percentage, Average, Powers and Exponents (Surds and Indices), Time and Work, Mensuration and Geometry, Age Problems, Pipe and Cistern, Probability, Profit and Loss, Simple Interest and Compound Interest, Algebra
- Analytical and Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Directions (Direction Test), Ranking, Order and Sequence, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Logical Sequence Of Words, Puzzle Solving (Puzzles), Syllogisms, Seating Arrangements, Calendar, Clock, Blood Relations, Cubes & Dices, Venn Diagram, Analytical Reasoning (Counting Figures Reasoning)
- Cognizant Gaming Aptitude: Gamified / Game Based Aptitude
- Java (Cluster 1): Java
- ANSI SQL MySQL (Cluster 1,2,3): SQL
- HTML, CSS, JavaScript (Cluster 1,3): HTML, CSS, JavaScript
- Python (Cluster 2): Python for Placements by Yash Sir
- Cloud Fundamentals (Cluster 2): Emerging Tech Trends
- C# (Cluster 3): C#
- OOPs: Object Oriented Programming (OOPS)
- Technical Assessment (Coding): Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Pseudo Codes
- Data Structures: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- DBMS: Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Decomposition Properties & 4NF, File Organization & Indexing, Relational Algebra, Relational Calculus, Transaction Management, Concurrency Control, Database Recovery, ORDBMS, Database Security & Authorization, Query Processing & Optimization, Enhanced Data Models, Data Warehousing & Mining, Big Data Systems, NoSQL
- Operating Systems: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS, Linux OS, Security, Distributed Systems, Virtual Machines
- Computer Networks: Introduction to CN, Data Communication, DLL: Access Control, DLL: Flow Control, DLL: Error Control, DLL: Framing, Data Link Layer - Ethernet, Net Layer: IPv4 & Proto, Net Layer: IP Addressing, Net Layer:Routing Protocol, Transport Layer Services, TL: Congestion & UDP, Application Layer, Hardware basics, Network Security, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
This educational video, presented by a 'Placement Expert' from Knowledge Gate, teaches how to find the Least Common Multiple (LCM) of two numbers using programming. The lecture begins by defining the problem and providing sample input-output pairs. It then explains the mathematical logic of LCM using prime factorization, demonstrating the method with the numbers 15 and 25. The video transitions to a more efficient algorithm based on the formula LCM(a, b) = (a * b) / GCD(a, b). The core of the lesson is a step-by-step walkthrough of a C program that implements this solution, including a recursive function for calculating the Greatest Common Divisor (GCD) and a main function that takes user input and prints the result.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with the Knowledge Gate logo, followed by a slide showing the organization's various educational channels. The main lecture begins with a problem statement on a digital blackboard: 'Q6: Write a program find LCM of two numbers'. The instructor, identified as 'Yash Jain Sir', presents sample inputs and outputs, such as Input: 15 20, Output: 60, to clarify the expected behavior. The core concept is introduced with the definition 'LCM = Smallest Number that divides both'. The logic is explained using prime factorization, with the example of 15 and 25. The prime factors of 15 are 5 and 3, and for 25 are 5 and 5. The LCM is found by taking the union of all factors, which is 5, 5, and 3, resulting in 75. The instructor emphasizes that the LCM is the product of the union of all prime factors.
2:00 – 3:37 02:00-03:37
The video transitions to a more efficient algorithm for finding the LCM. The instructor states that a simple solution is to find the prime factors and take their union, but an efficient solution uses the formula LCM(a, b) = (a * b) / GCD(a, b). The formula is written on the board, and the instructor explains that the GCD (Greatest Common Divisor) is the key to this method. The lesson then shifts to a C code implementation. A code snippet is displayed, showing the inclusion of the stdio.h header and the definition of a recursive function `int gcd(int a, int b)` which uses the Euclidean algorithm. The `int lcm(int a, int b)` function is shown to calculate the LCM using the formula. The `main()` function is presented, which takes two integers as input, calls the `lcm` function, and prints the result. The instructor then demonstrates the GCD calculation for a=6 and b=12, showing the recursive steps: `gcd(6,12)` calls `gcd(12%6, 6)` which is `gcd(0,6)`, and since a=0, it returns 6. This GCD value is then used to calculate the LCM.
The video provides a comprehensive, step-by-step guide to solving the LCM problem. It starts with a conceptual understanding of LCM using prime factorization, which is a fundamental but less efficient method. It then introduces a more practical and efficient algorithm based on the mathematical relationship between LCM and GCD. The core of the lesson is the implementation of this algorithm in C, with a clear, well-structured code example that includes a recursive GCD function. The instructor effectively bridges the gap between mathematical theory and programming practice, making the concept accessible for students preparing for coding interviews.