Find second largest number from given 3 numbers

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/COCUBES-PREPARATION/coding/coding-questions/coding-question/asset-find-second-largest-number-from-given-3-numbers after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Aptitude: Number System, Divisibility Rules, HCF LCM, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Mixture and Alligation, Partnership, Age Problems, Time and Work, Pipe and Cistern, Speed Time and Distance, Algebra, Arithmetic, Data Interpretation, Sequence and Series (Series), Logarithm, Powers and Exponents (Surds and Indices), Permutation and Combination, Probability, Speed Mathematics and Basic Mathematics, Trigonometry
  2. Logical Reasoning: Coding Decoding, Blood Relations, Directions (Direction Test), Ranking, Order and Sequence, Seating Arrangements, Puzzle Solving (Puzzles), Data Arrangement, Syllogisms, Inequality, Data Sufficiency, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Series (Number and Letter Series) (Numerical Relations and Reasoning), Venn Diagram, Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning)
  3. Verbal Ability: Noun, Pronoun, Adjectives, Verb, Adverb, Tenses, Subject Verb Agreement (Verb Noun Agreement), Articles, Preposition, Conjunction, Modals, Determiner, Vocabulary, 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), Active Passive Voice (Voice), Direct and Indirect Speech, Sentence Construction
  4. Data Structures (Domain Test): Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  5. Algorithms (Domain Test):
  6. OOPs (Domain Test): Object Oriented Programming (OOPS)
  7. DBMS (Domain Test): 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
  8. SQL (Domain Test): SQL
  9. Operating Systems (Domain Test): 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
  10. Computer Networks (Domain Test): 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, Cloud Computing and IoT, Cyber and Info Security
  11. Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  12. Written English Test: English Writing Ability
  13. Psychometric Test: Behavioral Assessment (Behavioral Competency Profiling) (Psychometric Test)
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This educational video, presented by a 'Placement Expert' from Knowledge Gate, is a C programming tutorial focused on solving algorithmic problems involving comparisons of integers. The lecture begins by introducing a problem (Q9) to find the second largest number among three given integers, providing input/output specifications and test cases. The instructor then displays a C code solution that uses nested if-else statements to compare the three numbers and determine the second largest. The logic is broken down into cases: first, it checks if the first number is the largest, then compares the other two; if not, it checks if the second number is the largest, and so on. The video transitions to a second problem (Q8) to find the smallest of four numbers, showing a different approach using a variable 'min' initialized to the first number and updated through sequential comparisons. The final segment demonstrates the code execution in an online C compiler, showing the program being compiled and run with sample inputs, confirming the correct output. The overall teaching style is direct, using a digital blackboard to write and explain code, with the instructor providing commentary throughout.

Chapters

  1. 0:00 – 2:00 00:00-02:00

    The video opens with the 'Knowledge Gate' logo, followed by a slide introducing the channel's social media handles. The main content begins with a presentation slide for problem Q9: 'Find out second largest numbers of 3 numbers'. The slide details the input (three integers) and output (the second largest number) and provides two public test cases: one with inputs -4 0 4 yielding output 0, and another with 101 101 98 yielding output 101. The instructor then transitions to a code editor, displaying a C program. The code includes the standard header, a main function, and variables 'a', 'b', and 'c'. It prompts the user to 'Enter 3 numbers', reads them, and uses a complex nested if-else structure to determine the second largest. The logic first checks if 'a' is the largest, then compares 'b' and 'c' to find the second largest. If 'a' is not the largest, it checks if 'b' is the largest, and so on. The instructor explains this logic, with the code visible on the screen, and a 'Code' label in the top right corner.

  2. 2:00 – 2:38 02:00-02:38

    The video transitions to a new problem, Q8: 'Find out smallest of 4 numbers (numbers are not equal)'. The slide shows the problem statement and two test cases: inputs -2 0 2 yielding output -2, and 1875 690 2017 yielding output 690. The instructor then displays a new C code snippet for this problem. The code declares four integers 'a', 'b', 'c', 'd' and a variable 'min'. It reads the four numbers and initializes 'min' to 'a'. It then uses a series of if statements to compare 'b', 'c', and 'd' with 'min', updating 'min' if a smaller number is found. The final output is the value of 'min'. The instructor explains this method of finding the minimum. The video then shows the code being executed in the 'OnlineGDB' compiler. The program is compiled successfully, and the user is prompted to 'Enter 3 numbers'. The instructor types '1 2 3' as input, and the program outputs '2', which is the second largest number, confirming the logic of the previously shown code.

The video presents a structured, step-by-step tutorial on solving two fundamental programming problems in C: finding the second largest of three numbers and the smallest of four numbers. It demonstrates two distinct algorithmic approaches: a complex, case-based logic using nested conditionals for the first problem, and a simpler, iterative method using a 'min' variable for the second. The progression from problem definition to code implementation and finally to live execution in a compiler provides a comprehensive learning experience, reinforcing the concepts of input/output, conditional logic, and variable manipulation.

Loading lesson…