Q1 - Precedence and Associativity

Duration: 3 min

This video lesson is available to enrolled students.

Return to /learn/HEXAWARE-PREPARATION/programming-basics-ccjavapython/programming-in-c/c-by-yash-sir/asset-q1-precedence-and-associativity after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. Quantitative Ability: Speed Mathematics and Basic Mathematics, Percentage, Ratio and Proportion (Ratios), Average, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Speed Time and Distance, Number System, HCF LCM, Data Interpretation, Age Problems, Mixture and Alligation, Partnership, Algebra, Sequence and Series (Series), Mensuration and Geometry, Arithmetic
  2. Reasoning Ability: Puzzle Solving (Puzzles), Seating Arrangements, Coding Decoding, Blood Relations, Directions (Direction Test), Syllogisms, Data Sufficiency, Ranking, Order and Sequence, Series (Number and Letter Series) (Numerical Relations and Reasoning), Logical Sequence Of Words, Calendar, Clock, Cubes & Dices, Analytical Reasoning (Counting Figures Reasoning), Data Arrangement, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning)
  3. Verbal Ability: Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Cloze Test (Cloze Passage), Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Vocabulary, Sentence Completion (Fill in the blanks), Active Passive Voice (Voice), Direct and Indirect Speech, Subject Verb Agreement (Verb Noun Agreement), Tenses, Preposition, Articles, Sentence Correction (Error Correction)
  4. Programming Basics (MCQs + Interview): C Programming by Yash Sir, Programming in C++, Java, Python for Placements by Yash Sir
  5. OOPs (MCQs + Interview): Object Oriented Programming (OOPS)
  6. DBMS (MCQs + Interview): Basics of DBMS, ER Diagram, Relational Model & Functional Dependencies, Keys & Integrity Constraints, Normalization (1NF - BCNF), Transaction Management, Decomposition Properties & 4NF, Concurrency Control, Database Recovery, File Organization & Indexing, Relational Algebra, Database Security & Authorization
  7. SQL (MCQs + Interview): SQL
  8. Operating Systems (MCQs + Interview): Introduction to OS, Process Management, CPU Scheduling, Deadlock, Threads & Process Creation, Memory Management, Virtual Memory, Process Synchronization, Disc Scheduling, File Management, Security
  9. Computer Networks (MCQs + 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, Mobile Technology, Cloud Computing and IoT, Cyber and Info Security
  10. Coding: Coding Questions by Yash Sir
  11. HR Interview: MR & HR Interview Preparation
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

The video is a tutorial on solving a C++ programming problem from a Puma's Rebl Tech coding challenge. The instructor, Yash Jain, presents a C++ code snippet that calculates a complex arithmetic expression involving variables a through f. He then methodically breaks down the expression, applying the rules of operator precedence (parentheses, multiplication, division, addition, subtraction) to solve it step-by-step on a whiteboard. The final result of the calculation is determined to be 10. The video concludes with a demonstration of the code running in an online compiler, which confirms the result by outputting 10.

Chapters

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

    The video opens with a C++ code snippet displayed in a dark-themed editor. The code defines variables a=8, b=4, c=2, d=1, e=5, f=20 and contains a single cout statement with a complex arithmetic expression: `a + b - (c + d) * 3 % e + f / 9;`. The instructor, Yash Jain, begins to solve this expression by first substituting the variable values, writing `8 + 4 - (2 + 1) * 3 % 5 + 20 / 9` on a whiteboard. He then proceeds to evaluate the expression step-by-step, starting with the parentheses `(2 + 1)` which equals 3, resulting in `8 + 4 - 3 * 3 % 5 + 20 / 9`. He then evaluates the multiplication `3 * 3` to get 9, leading to `8 + 4 - 9 % 5 + 20 / 9`. The instructor then evaluates the modulus operation `9 % 5`, which is 4, and the division `20 / 9`, which is 2 (due to integer division), resulting in the expression `8 + 4 - 4 + 2`. The on-screen text includes the code link `https://onlinegdb.com/sLZ1jinZN` and the instructor's name and credentials.

  2. 2:00 – 3:13 02:00-03:13

    The instructor continues the step-by-step evaluation of the arithmetic expression on the whiteboard. He simplifies the expression `8 + 4 - 4 + 2` by performing the addition and subtraction from left to right. First, `8 + 4` equals 12, resulting in `12 - 4 + 2`. Then, `12 - 4` equals 8, resulting in `8 + 2`. Finally, `8 + 2` equals 10. The instructor confirms the final answer is 10. The video then transitions to a screen recording of the online GDB compiler, where the same C++ code is executed. The console output clearly shows the result `10`, confirming the manual calculation. The instructor's name, Yash Jain, and his title as a Coding Expert are visible in a circular frame on the right.

The video provides a comprehensive walkthrough of a C++ coding problem, emphasizing the practical application of operator precedence. It begins with a complex expression and systematically breaks it down into manageable steps, demonstrating the correct order of operations (parentheses, multiplication/division/modulus, then addition/subtraction). The instructor's methodical approach, combining manual calculation on a whiteboard with a live code execution in a compiler, reinforces the learning process and validates the final answer, making it a clear and effective tutorial for understanding basic arithmetic in programming.

Loading lesson…