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
- 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
- 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)
- 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
- Programming Fundamentals (Technical): C Fundamentals
- Data Structures (Technical): Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
- Algorithms (Technical): Algorithm Analysis, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Minimum Spanning Trees, Shortest Path Algos, Time Complexity Analysis, Advanced Algorithms
- OOPs (Technical): Object Oriented Programming (OOPS)
- 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
- SQL (Technical): SQL
- 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
- 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
- Software Engineering (Technical): Fundamentals of Software Engineering, Software Requirements and Quality Assurance, Software Design, Estimation and Metrics, Software Testing, Software Maintenance and Configuration Management
- 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
- Personality / Behavioral Assessment: Behavioral Assessment (Behavioral Competency Profiling) (Psychometric Test)
- Writing Assessment: English Writing Ability
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.

