Find maximum of 3 numbers

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/CDAC-C-CAT-COMPLETE-PREPARATION/section-b-c-programming/coding-questions/coding-question/asset-find-maximum-of-3-numbers after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Section A | English: Vocabulary, Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Preposition, Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Articles, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Verbal Analogy (Word Based Analogy)
  2. Section A | Quant Aptitude: Ratio and Proportion (Ratios), Mixture and Alligation, Permutation and Combination, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Arithmetic, Algebra, Powers and Exponents (Surds and Indices), Average, Age Problems, Percentage, Profit and Loss, Partnership, Time and Work, Simple Interest and Compound Interest, Mensuration and Geometry, Probability, Pipe and Cistern
  3. Section A | Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Calendar, Clock, Blood Relations, Directions (Direction Test), Seating Arrangements, Ranking, Order and Sequence, Puzzle Solving (Puzzles)
  4. Section B | C Programming: C Programming by Yash Sir, Coding Questions by Yash Sir
  5. Section B | Data Structures: Algorithm Analysis, Greedy Algorithms, Time Complexity Analysis, Sorting Algorithms, Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs
  6. Section B | OOP (C++): Object Oriented Programming (OOPS), Programming in C++
  7. Section B | OS: Introduction to OS, Process Management, CPU Scheduling, Process Synchronization, Threads & Process Creation, Deadlock, Memory Management, Virtual Memory, Disc Scheduling, File Management, Windows OS
  8. Section B | Networking: 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
  9. Section B | AI & Big Data Basics: AI & ML by Arun Sir, Big Data Systems
  10. Section C | Digital Electronics: Digital Systems & Boolean Basics, Logic Gates & Hardware, Boolean Expression, Boolean Minimization, Combinational Circuit, Sequential Circuits, Number System, Number Representation, Analog-Digital Conversion
  11. Section A, C | Comp. Fundamentals, COA: Basics of COA, Floating Point Rep, Cache Memory Organization, Input Output Organisation, Pipelining, Instr Formats & Modes, Control Unit Design, Register Transfer and Microoperations, Multiprocessors, Programming the Basic Computer
  12. MOCK TEST:
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This video is a programming tutorial from Knowledge Gate Eduventures, focusing on solving the problem of finding the greatest of three numbers using C programming. The instructor first presents the problem statement, which includes input and output specifications and a public test case with inputs 12, 8, 47 and expected output 47. The core of the lesson is a step-by-step walkthrough of a C code solution. The code, displayed on a digital blackboard, uses the `#include <stdio.h>` header and a `main()` function. It declares three integer variables `a`, `b`, and `c`, and a variable `max` to store the result. The program reads the three numbers using `scanf`. The logic to find the maximum is implemented with a series of `if-else` statements: it first compares `a` and `b` to determine the larger of the two, storing the result in `max`. It then compares this `max` value with `c` to find the overall greatest number. Finally, the program prints the value of `max`. The instructor uses the blackboard to illustrate the logic flow, writing out the variables and the step-by-step comparison process, including a hand-drawn example with the values 10, 12, and 14 to demonstrate how the logic works.

Chapters

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

    The video begins with the 'KNOX MEEHEGATF' logo, which is a stylized version of 'KNOWLEDGE GATE'. It then transitions to a slide showing the 'KNOWLEDGE GATE' brand and its social media handles for various educational streams like 'KG GATE & PLACEMENT PREP', 'KG CODING', and 'KG UGC NET COLLEGE PREP'. The main content starts with a problem statement for 'Q7: Find out greatest of 3 numbers (3 numbers are not equal)'. The problem specifies the input format as three integers separated by space and the output as the greatest number. A public test case is provided: Input: 12 8 47, Output: 47. The instructor, Yash Jain Sir, is visible in a small window, and the video is marked as proprietary content of KNOWLEDGE GATE EDUVENTURES.

  2. 2:00 – 2:45 02:00-02:45

    The video displays a C code solution on a digital blackboard. The code begins with `#include <stdio.h>` and defines the `main()` function. Inside, it declares variables `int a, b, c, max;`. The `scanf("%d %d %d", &a, &b, &c);` function reads the three integers. The logic to find the maximum is implemented with `if (a > b)` to compare the first two numbers, setting `max = a` if true, otherwise `max = b`. Then, `if (c > max)` compares the third number with the current maximum, updating `max = c` if true. Finally, `printf("%d", max);` prints the result. The instructor uses the blackboard to draw the logic flow, writing 'a b c' and demonstrating the comparison process with the values 10, 12, 14, showing how `max` is updated step-by-step.

The video provides a clear, structured tutorial on a fundamental programming problem. It follows a logical progression from problem definition to implementation. The instructor first establishes the problem's requirements, then presents a complete C program. The core of the lesson is the explanation of the algorithm, which uses sequential conditional checks to find the maximum value. The visual aid of the digital blackboard, with handwritten annotations and a step-by-step walkthrough of the logic, effectively reinforces the concept of using `if-else` statements to compare multiple values, making the solution easy to understand and replicate.

Loading lesson…