Q2 - Precedence and Associativity

Duration: 2 min

This video lesson is available to enrolled students.

Return to /learn/COGNIZANT-PREPARATION/technical-assessment/programming-in-c/c-by-yash-sir/asset-q2-precedence-and-associativity after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. 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
  2. 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
  3. 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)
  4. Cognizant Gaming Aptitude: Gamified / Game Based Aptitude
  5. Java (Cluster 1): Java
  6. ANSI SQL MySQL (Cluster 1,2,3): SQL
  7. HTML, CSS, JavaScript (Cluster 1,3): HTML, CSS, JavaScript
  8. Python (Cluster 2): Python for Placements by Yash Sir
  9. Cloud Fundamentals (Cluster 2): Emerging Tech Trends
  10. C# (Cluster 3): C#
  11. OOPs: Object Oriented Programming (OOPS)
  12. Technical Assessment (Coding): Coding Questions by Yash Sir, C Programming by Yash Sir, Programming in C++, Pseudo Codes
  13. Data Structures: Introduction to DS, Array, Stack, Queue, Linked List, Tree, Graphs, Hashing
  14. 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
  15. 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
  16. 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.

The video is a tutorial on solving a C++ programming problem from Puma's Rebl TAC, presented by a coding expert. The instructor first displays a C++ code snippet that defines five integer variables (a=17, b=5, c=6, d=3, e=5) and a complex arithmetic expression within a cout statement. The core of the lesson involves manually evaluating this expression step-by-step, following the standard order of operations (PEMDAS/BODMAS). The instructor breaks down the expression into parts, calculating the modulo operation (a % 6), the division (b / 2), and the multiplication and subtraction within the parentheses (c * d - 5), then combines the results. The final calculation is shown as (17 % 6) - (5 / 2) + ((6 * 3) - 5) / 5, which simplifies to 5 - 2 + 13 / 5, and finally to 3 + 2, resulting in 5. The video concludes with a screen recording of an online C++ compiler where the program is executed, confirming the output is 5.

Chapters

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

    The video begins with a C++ code snippet displayed on a dark background, which includes the standard library and namespace. The main function initializes five integer variables: a=17, b=5, c=6, d=3, and e=5. The core of the code is a cout statement with a complex arithmetic expression: a % 6 - b / 2 + (c * d - 5) / e. The instructor, visible in a circular frame, starts to solve this expression by hand. He first calculates the modulo operation, writing '17 % 6' and then '5' as the result. He then moves to the division, writing '5 / 2' and calculating it as 2. Next, he evaluates the expression within the parentheses, writing '6 * 3 - 5' and calculating it as 18 - 5, which is 13. The expression is now simplified to 5 - 2 + 13 / 5. He then calculates 13 / 5 as 2, and the final expression becomes 5 - 2 + 2, which he simplifies to 3 + 2, resulting in 5. The instructor's handwritten notes on the right side of the screen clearly show each step of the calculation.

  2. 2:00 – 2:18 02:00-02:18

    The video transitions to a screen recording of an online C++ compiler, showing the same code in a text editor. The instructor runs the program, and the console output appears at the bottom of the screen. The output is '5', which matches the result of the manual calculation. The text 'Program finished with exit code 0' is also visible, confirming the program executed successfully. The instructor's face remains visible in the circular frame on the right, and the video ends with the compiler window showing the correct output.

The video provides a comprehensive walkthrough of a C++ arithmetic expression evaluation problem. It effectively combines a theoretical explanation with a practical verification. The instructor first demonstrates the correct application of operator precedence by breaking down the complex expression into its constituent parts, showing the step-by-step calculation on a whiteboard. This pedagogical approach ensures the viewer understands the logic. The lesson is then validated by running the actual code in a compiler, which produces the same result, reinforcing the correctness of the manual calculation and demonstrating the practical application of the concepts.

Loading lesson…