Distance between 2 points if coordinates are given

Duration: 4 min

This video lesson is available to enrolled students.

Return to /learn/AMCAT-PREPARATION/codingautomata-round/coding-questions/coding-question/asset-distance-between-2-points-if-coordinates-are-given after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Ability: Percentage, Profit and Loss, Ratio and Proportion (Ratios), Average, Time and Work, Speed Time and Distance, Simple Interest and Compound Interest, Age Problems, Number System, Divisibility Rules, HCF LCM, Algebra, Permutation and Combination, Probability, Data Interpretation, Logarithm, Sequence and Series (Series), Powers and Exponents (Surds and Indices), Speed Mathematics and Basic Mathematics
  2. Logical Reasoning: Seating Arrangements, Puzzle Solving (Puzzles), Data Arrangement, Coding Decoding, Blood Relations, Directions (Direction Test), Ranking, Order and Sequence, Data Sufficiency, Venn Diagram, Inequality, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Selection Decision Table (Decision Making), Analogy, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning)
  3. Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Subject Verb Agreement (Verb Noun Agreement), Tenses, Articles, Preposition, Conjunction, Modals, Active Passive Voice (Voice), Direct and Indirect Speech, Vocabulary, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Completion (Fill in the blanks), Sentence Correction (Error Correction), Cloze Test (Cloze Passage), Facts, Inference and Judgements
  4. Programming Fundamentals (Technical): C Fundamentals
  5. Data Structures (Technical): Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  6. Algorithms (Technical): Algorithm Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos, Time Complexity Analysis, Advanced Algorithms
  7. OOPs (Technical): Object Oriented Programming (OOPS)
  8. DBMS (Technical): 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
  9. SQL (Technical): SQL
  10. Operating Systems (Technical): 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
  11. Computer Networks (Technical): 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
  12. Software Engineering (Technical): Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
  13. Coding/Automata Round: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir, Pseudo Codes
  14. Personality / Behavioral Assessment: Behavioral Assessment (Behavioral Competency Profiling) (Psychometric Test)
  15. Writing Assessment: English Writing Ability
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This educational video, presented by a lecturer from Knowledge Gate, covers two programming problems in C. The first segment demonstrates a program to calculate the Greatest Common Divisor (GCD) and Least Common Multiple (LCM) of two numbers using recursive functions, with a step-by-step trace of the GCD function for inputs 6 and 12. The second segment addresses a problem to find the distance between two points given their coordinates. The instructor explains the mathematical logic, deriving the distance formula from the Pythagorean theorem, and then presents a complete C program that uses the `sqrt` and `pow` functions from the math library to compute the distance. The video uses a blackboard interface to write code and diagrams, with the instructor providing verbal explanations throughout.

Chapters

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

    The video begins with the Knowledge Gate logo, followed by a screen showing the organization's various educational channels. The main content starts with a C program on a blackboard to calculate the GCD and LCM of two numbers. The instructor explains the recursive logic of the `gcd` function, showing a trace for inputs a=6 and b=12, which results in a GCD of 6. The `lcm` function is defined as (a*b)/gcd(a,b). The code is written using `#include <stdio.h>` and includes a `main` function that takes user input and prints the GCD and LCM. The instructor, identified as Yash Jain Sir, is visible in a small window, explaining the code and its logic.

  2. 2:00 – 4:20 02:00-04:20

    The video transitions to a new problem: writing a program to find the distance between two points. The instructor writes the problem statement on the blackboard. He then explains the logic, stating that the distance formula is derived from the Pythagorean theorem. A diagram is shown illustrating a right-angled triangle with vertices at (x1,y1) and (x2,y2), where the legs are (x2-x1) and (y2-y1), and the hypotenuse is the distance 'd'. The formula is written as Distance = √((x2-x1)² + (y2-y1)²). The instructor then presents the C code, which includes `#include <stdio.h>` and `#include <math.h>`. A function `double distance(int x1, int y1, int x2, int y2)` is defined to calculate the distance using `sqrt(pow(x2-x1, 2) + pow(y2-y1, 2))`. The `main` function prompts the user for the coordinates of two points and calls the `distance` function to print the result.

The video provides a structured, step-by-step tutorial on solving two common programming problems in C. It begins with a detailed explanation of recursive algorithms for GCD and LCM, using a trace to illustrate the function calls. It then transitions to a geometric problem, first establishing the mathematical foundation with the Pythagorean theorem and a diagram, before implementing the solution in code. The progression moves from algorithmic logic to mathematical application, demonstrating how to translate a real-world problem into a functional C program, with a consistent focus on clear code structure and the use of standard library functions.

Loading lesson…