Dereference or Multiply (Lots of Confusion)

Duration: 9 min

This video lesson is available to enrolled students.

Return to /learn/TCS-NQT-PREPARATION/advanced-coding/c-programming-by-yash-sir/c-language-mcqs/asset-dereference-or-multiply-lots-of-confusion after enrolling

Inside: a video lesson and guided study material.

Module outline

  1. TCS One Shot Free Videos & Notes: TCS Preparation
  2. Numerical Ability (Foundation Section): Ratio and Proportion (Ratios), Divisibility Rules, Data Interpretation, Mixture and Alligation, Permutation and Combination, Logarithm, Number System, HCF LCM, Sequence and Series (Series), Speed Time and Distance, Percentage, Average, Powers and Exponents (Surds and Indices), Algebra, Probability, Profit and Loss, Simple Interest and Compound Interest, Time and Work, Pipe and Cistern, Mensuration and Geometry, Mental Ability, Age Problems, Statistics, Arithmetic, Partnership, Speed Mathematics and Basic Mathematics
  3. Reasoning Ability (Foundation Section): Series (Number and Letter Series) (Numerical Relations and Reasoning), Coding Decoding, Data Sufficiency, Non Verbal Reasoning (Spatial Aptitude) (Spatial Reasoning) (Visual Reasoning), Syllogisms, Deductive and Inductive Reasoning (Logical Deduction and Induction) (Prepositional Reasoning), Seating Arrangements, Blood Relations, Directions (Direction Test), Analytical Reasoning (Counting Figures Reasoning), Puzzle Solving (Puzzles), Calendar, Clock, Cubes & Dices, Selection Decision Table (Decision Making), Crypt Arithmetic, Venn Diagram, Data Arrangement, Inequality, Analogy, Ranking, Order and Sequence, Logical Sequence Of Words
  4. New Pattern-Verbal Ability (Foundation Section): Sentence Completion (Fill in the blanks), English Writing Ability
  5. Old Pattern-Verbal Ability (Foundation Section): Vocabulary, Noun, Subject Verb Agreement (Verb Noun Agreement), Adjectives, Tenses, Pronoun, Preposition, Articles, Direct and Indirect Speech, Conjunction, Modals, Sentence Re-arrangements (Para Jumbles) (Narrative Sequencing), Sentence Correction (Error Correction), Comprehension / Reading Comprehension / Unseen Passages (Critical Reasoning) (Paragraph Questions), Verbal Analogy (Word Based Analogy), Active Passive Voice (Voice), Determiner, Facts, Inference and Judgements, Adverb, Cloze Test (Cloze Passage), Sentence Construction, Verb
  6. Advanced Quantitative Ability: TCS NQT Advanced Quantitative Ability
  7. Advanced Reasoning Ability: TCS NQT Advanced Reasoning Ability
  8. Advanced Coding: Coding Questions by Yash Sir, C Programming by Yash Sir, Python for Placements by Yash Sir, DSA using Python, Object Oriented Programming (OOPS), Programming in C++, Java
  9. TCS Full Length Mock Test:
  10. TCS Interview & Resume Prep: MR & HR Interview Preparation, TCS Interview Preparation, Mock Interview, Interview Recordings, Resume Preparation, Resume Review
  11. Mega Test:
  12. Grand Test:
AI summary & chapters

AI Summary

An AI-generated summary of this video lecture.

This educational video is a lecture on C programming, specifically focusing on pointers and operator precedence. The video begins with an introduction to a multiple-choice question (MCQ) from the L&T Infotech (LTI) 2018 exam, which involves a C program with pointers. The instructor then proceeds to analyze the code line by line, using a digital blackboard to illustrate the memory layout and the values of variables. He explains the declaration of an integer variable `i` with a value of 6, a pointer `j` that is assigned the address of `i`, and a variable `k`. The core of the analysis is the `printf` statement, where the instructor breaks down the expression `i * j * i + j` by first identifying the values of `i` (6) and `j` (the address of `i`, which is 100). He then applies the rules of operator precedence, noting that multiplication has higher precedence than addition, and that the `*` operator is left-associative. The calculation is shown as `(6 * 100 * 6) + 100`, which simplifies to `3600 + 100`, resulting in an output of 3700. The video concludes with a summary table of C operators, their descriptions, and their associativity, reinforcing the concept of operator precedence.

Chapters

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

    The video opens with a title slide for a C Programming MCQs lecture by Yash Jain, featuring a glowing keyboard and a small video of the instructor. The scene transitions to a presentation slide with a large golden 'C' and a green box labeled 'POINTERS' with gears, indicating the topic. The instructor, visible in a small window, begins the lecture. The main content area then displays a C code snippet from an L&T Infotech (LTI) 2018 exam question, which includes the `#include <stdio.h>` directive, a `main()` function, and a `printf` statement with a complex expression involving pointers. The instructor starts to explain the code, focusing on the variable declarations and the `printf` function.

  2. 2:00 – 5:00 02:00-05:00

    The instructor analyzes the C code on the digital blackboard. He explains that `int i = 6;` declares an integer variable `i` with a value of 6. He then explains `*j, k;` as declaring a pointer `j` and an integer `k`. The line `j = &i;` is explained as assigning the address of `i` to the pointer `j`. The instructor draws a diagram showing `i` with a value of 6 at memory address 100, and `j` as a pointer holding the value 100 (the address of `i`). He then focuses on the `printf` statement, `printf("%d\n", i * j * i + j);`, and begins to break down the expression. He identifies the values of `i` (6) and `j` (100) and starts to calculate the result, writing `6 * 100 * 6 + 100` on the board.

  3. 5:00 – 8:53 05:00-08:53

    The instructor completes the calculation of the expression `i * j * i + j`. He applies the rules of operator precedence, stating that multiplication (`*`) has higher precedence than addition (`+`), and that the `*` operator is left-associative. He calculates `6 * 100 * 6` as `(6 * 100) * 6 = 600 * 6 = 3600`, and then adds `j` (100) to get `3600 + 100 = 3700`. He writes the final answer, 3700, on the board. The video then transitions to a summary slide that displays a table of C operators, including `()`, `->`, `++`, `*`, `+`, `<<`, and their descriptions and associativity (left to right or right to left). The instructor concludes the lesson by summarizing the key concepts of pointer arithmetic and operator precedence.

The video provides a comprehensive, step-by-step analysis of a C programming problem that tests understanding of pointers and operator precedence. It begins with a real-world exam question, then uses a clear, visual approach to deconstruct the code. The instructor effectively uses a digital blackboard to illustrate the memory model, showing how a pointer holds the address of a variable. The core of the lesson is the application of operator precedence rules to evaluate a complex expression, demonstrating that multiplication is performed before addition and that the `*` operator is left-associative. The final summary table reinforces the foundational knowledge of C operators, making the video a valuable resource for students preparing for programming exams.

Loading lesson…