Convert Decimal to Octal

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/WIPRO-PREPARATION/coeding/coding-questions/coding-question/asset-convert-decimal-to-octal after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Aptitude: Number System, Percentage, Profit and Loss, Ratio and Proportion (Ratios), Average, Time and Work, Speed Time and Distance, Simple Interest and Compound Interest, Mixture and Alligation, Data Interpretation, Permutation and Combination, Probability, Logarithm, Powers and Exponents (Surds and Indices), Age Problems, Divisibility Rules, Partnership, HCF LCM, Algebra, Pipe and Cistern
  2. Logical Reasoning: Series (Number and Letter Series) (Numerical Relations and Reasoning), Analogy, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Logical Sequence Of Words, Data Sufficiency, Seating Arrangements, Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Data Arrangement
  3. English Language: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Sentence Correction (Error Correction), Sentence Completion (Fill in the blanks), Vocabulary, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Active Passive Voice (Voice), Direct and Indirect Speech, Cloze Test (Cloze Passage), Tenses, Subject Verb Agreement (Verb Noun Agreement), Preposition, Articles, Conjunction, Adverb
  4. Written English Test: English Writing Ability
  5. Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  6. Communication Round: Communication Assessment
  7. DBMS (Technical Interview): 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, Big Data Systems, NoSQL, Data Warehousing & Mining
  8. SQL (Technical Interview): SQL
  9. Operating Systems (Technical Interview): 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
  10. Computer Networks (Technical Interview): 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
  11. OOPs (Technical Interview): Object Oriented Programming (OOPS)
  12. HR Interview: MR & HR Interview Preparation
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This video is a programming tutorial from Knowledge Gate that teaches how to convert a decimal number to an octal number. The lesson begins with an introduction to the problem, which is to write a C program to convert a decimal number to octal. The instructor first explains the manual conversion process using the division-by-8 method, demonstrating it with the decimal number 33, which results in the octal number 41. The video then transitions to the coding part, where the instructor displays a C program. The code uses a loop to repeatedly divide the input number by 8, collecting the remainders to form the octal number. The instructor walks through the code, explaining the logic and variables, and demonstrates the step-by-step calculation of the octal equivalent of 33, showing how the final result is built digit by digit.

Chapters

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

    The video starts with the Knowledge Gate logo, followed by a slide showing the company's various educational offerings. The main content begins with a PowerPoint presentation titled 'Q2: Write a program to convert Decimal to Octal'. The instructor, identified as a 'Placement Expert', introduces the topic. The screen then displays a diagram under the heading 'Logic' that illustrates the manual conversion of the decimal number 33 to octal. The process involves dividing 33 by 8, which gives a quotient of 4 and a remainder of 1. Then, 4 is divided by 8, giving a quotient of 0 and a remainder of 4. The remainders are read in reverse order to get the octal number 41. The instructor explains this logic, emphasizing the division-by-8 method.

  2. 2:00 – 2:41 02:00-02:41

    The video transitions to the 'Code' section, where a C program is displayed on the screen. The code includes the standard header file, a main function, and variables for the input number (n), a temporary variable (dn), a variable to store the octal result (binno), and loop counters (i, j). The program uses a for loop to repeatedly divide the number by 8. The instructor explains the logic, noting that the remainder of each division (n%8) is added to the result (binno) after being multiplied by a power of 10 (i). The variable 'i' is multiplied by 10 in each iteration to shift the place value. The instructor demonstrates the calculation step-by-step, showing that for n=33, the first iteration gives a remainder of 1, which is added to binno (0 + 1*1 = 1). The second iteration gives a remainder of 4, which is added to binno (1 + 4*10 = 41). The final printf statement outputs the result, confirming the octal of 33 is 41.

The video provides a comprehensive, step-by-step tutorial on converting a decimal number to octal, covering both the theoretical logic and its practical implementation in C. It begins with a clear explanation of the manual division method, using a worked example to build understanding. This foundational knowledge is then directly applied to the programming solution. The instructor bridges the gap between the algorithm and the code by walking through the C program, explaining each line and variable, and demonstrating the calculation process. This approach ensures that students not only learn the code but also understand the underlying mathematical principle, making the lesson effective for both beginners and those looking to solidify their programming fundamentals.

Loading lesson…