Find maximum of 3 numbers

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/TCS-NQT-PREPARATION/advanced-coding/coding-questions/coding-question/asset-find-maximum-of-3-numbers after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. TCS One Shot Free Videos & Notes: TCS Preparation
  2. Numerical Ability (Foundation Section): Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Percentage, Average, Powers and Exponents (Surds and Indices), Algebra, Probability, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Mensuration and Geometry, Mental Ability, Age Problems, Statistics, Arithmetic, Partnership, Speed Mathematics and Basic Mathematics
  3. Reasoning Ability (Foundation Section): Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Syllogisms, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Seating Arrangements, Blood Relations, Directions (Direction Test), Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Selection Decision Table (Decision Making), Crypt Arithmetic, Venn Diagram, Data Arrangement, Inequality, Analogy, Ranking, Order and Sequence, Logical Sequence Of Words
  4. New Pattern-Verbal Ability (Foundation Section): Sentence Completion (Fill in the blanks), English Writing Ability
  5. Old Pattern-Verbal Ability (Foundation Section): Vocabulary, Noun, Subject Verb Agreement (Verb Noun Agreement), Adjectives, Tenses, Pronoun, Preposition, Articles, Direct and Indirect Speech, Conjunction, Modals, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Correction (Error Correction), Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Verbal Analogy (Word Based Analogy), Active Passive Voice (Voice), Determiner, Facts, Inference and Judgements, Adverb, Cloze Test (Cloze Passage), Sentence Construction, Verb
  6. Advanced Quantitative Ability: TCS NQT Advanced Quantitative Ability
  7. Advanced Reasoning Ability: TCS NQT Advanced Reasoning Ability
  8. Advanced Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Python for Placements by Yash Sir, DSA using Python, Object Oriented Programming (OOPS), Programming in C++, Java
  9. TCS Full Length Mock Test:
  10. TCS Interview & Resume Prep: MR & HR Interview Preparation, TCS Interview Preparation, Mock Interview, Interview Recordings, Resume Preparation, Resume Review
  11. Mega Test:
  12. Grand 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…