Find whether a given number is perfect square or not?
Duration: 5 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 video is a programming tutorial from Knowledge Gate Eduventures, presented by instructor Yash Jain Sir, that teaches how to determine if a given positive integer is a perfect square. The lesson begins with a problem statement (Q11) displayed on a digital chalkboard, which requires a program to output 'Success' for a perfect square and 'Failure' otherwise, with test cases provided. The instructor then explains the core logic: a number is a perfect square if its square root, when converted to an integer, when squared again, equals the original number. This is demonstrated with examples like 25 (sqrt is 5, 5*5=25) and 26 (sqrt is 5.099, 5*5=25, not 26). The final part of the video shows the implementation of this logic in C code, using the `sqrt()` function from the `math.h` library, and a conditional check to validate the result. The video is structured as a step-by-step guide, moving from problem definition to logical reasoning and finally to a working code solution.
Chapters
0:00 – 2:00 00:00-02:00
The video opens with the 'KNOX MEEHEGATF' logo, which is a stylized version of 'KNOWLEDGE GATE'. It then transitions to a presentation slide for 'KNOWLEDGE GATE' with four social media handles for different educational streams. The main content begins with a problem statement (Q11) on a digital chalkboard: 'Program to find whether a number is perfect square or not.' The input is defined as 'Any integer positive number' and the output as 'Print Success if the input number is a perfect square and failure if the input number is not a perfect square.' Two public test cases are shown: Input 625, Output 'Success', and Input 1002, Output 'Failure'. The instructor, Yash Jain Sir, is visible in a small window at the bottom right, and the video is watermarked with 'clideo.com' and a copyright notice for Knowledge Gate Eduventures.
2:00 – 5:00 02:00-05:00
The instructor begins explaining the logic for solving the problem. A green box labeled 'Logic' appears on the chalkboard. He demonstrates the concept with examples: for 25, the square root is 5, and 5 squared is 25, so it is a perfect square. For 26, the square root is approximately 5.099, which is a float. He writes '26 -> 5.24 (float)' and then shows that if this float is cast to an integer, it becomes 5. He explains that the key is to check if the integer value of the square root, when squared, equals the original number. He draws a diagram showing the process: take the number, find its square root, convert it to an integer, and then square that integer to see if it matches the original number. This logic is the foundation for the code that will be written.
5:00 – 5:21 05:00-05:21
The video transitions to the 'Code' section, with a green box labeled 'Code' on the chalkboard. The instructor displays a C program. The code includes the necessary headers: `#include <stdio.h>` and `#include <math.h>`. The `main()` function is defined. Inside, two variables are declared: `int n, intvar;`. The program uses `scanf("%d", &n);` to read the input. It then calculates the square root of `n` as a double: `double floatvar = sqrt((double)n);`. The double value is then cast to an integer: `intvar = (int)floatvar;`. The core logic is implemented with an `if` statement: `if (intvar * intvar == n)`. If true, it prints "Success"; otherwise, it prints "Failure". The instructor explains this code line by line, confirming it implements the logic discussed earlier.
The video provides a comprehensive, step-by-step tutorial on solving a common programming problem. It starts by clearly defining the problem and its expected inputs and outputs. The instructor then breaks down the solution into a logical concept, using mathematical examples to illustrate the principle of checking if a number is a perfect square by comparing the square of its integer square root to the original number. This logical foundation is then directly translated into a complete, functional C program. The progression from problem statement to logical reasoning to code implementation is clear and pedagogically sound, making it an effective learning resource for students preparing for coding interviews or competitive programming.