ParikshaBangla - Exams For A Stronger Bengal
WB PoliceClerkshipFood SIWBCSPricingExam Alerts
Sign In
Sign In
HomeBlogCoding Concepts
All Guides
Coding Concepts10 min read•Sep 10, 2026

10 Tricky C Programming Pointers & Recursion Traps Frequently Asked in WB JECA

Step-by-step memory dry-run tables for pointer arithmetic, pre/post increment, string literals, and recursive stack activations.

PB

ParikshaBangla Editorial Desk

WBJEEB Systems & C Programming Desk

Attempt Full Mocks

Why C Programming is the Deciding Factor in WB JECA

In WB JECA, C Programming questions are intentionally constructed with subtle compiler nuances, pointer arithmetic, and operator precedence traps that cannot be solved through rote memorization.

Here are 5 of the most repeated traps from previous WB JECA question papers, with complete dry-run memory traces.


Trap 1: sizeof() Operator on Array vs Pointer Parameter

Consider the following C snippet:

#include <stdio.h>

void func(int arr[]) {
    printf("%zu ", sizeof(arr));
}

int main() {
    int arr[10];
    printf("%zu ", sizeof(arr));
    func(arr);
    return 0;
}

Question: What is the output on a 64-bit architecture?

  • A) 40 40

  • B) 40 8 (Correct)

  • C) 10 10

  • D) 8 8

Analysis & Dry Run:

  1. In main(), arr is a true stack-allocated array of 10 integers. Since sizeof(int) = 4, sizeof(arr) = 10 * 4 = 40 bytes.

  2. When arr is passed to func(int arr[]), it decays into a pointer to its first element: int *arr.

  3. On a modern 64-bit architecture, any pointer variable occupies 8 bytes.

  4. Therefore, func() prints 8. Output: 40 8.


Trap 2: Modification of String Literals vs Character Arrays

char *p = "JECA";
char s[] = "JECA";

s[0] = 'M'; // Valid! Modifies stack memory
p[0] = 'M'; // SEGMENTATION FAULT at runtime!
  • char *p = "JECA"; stores the string literal in the read-only text/data segment (rodata) of memory. Attempting to write to it triggers a memory protection fault.

  • char s[] = "JECA"; copies the characters into stack memory, where write operations are fully permitted.


Trap 3: Pointer Arithmetic and Scaling

If integer pointer ptr points to address 0x1000, what is ptr + 3?

$$\text{Address} = \text{Base} + (3 \times \text{sizeof}(*\text{ptr})) = 0x1000 + (3 \times 4) = 0x1000 + 12 = 0x100C$$

Always remember: Pointer arithmetic scales automatically by the sizeof(data_type)!


Trap 4: Recursive Function Return Evaluation

What is the return value of mystery(5)?

int mystery(int n) {
    if (n <= 1) return 1;
    return n + mystery(n - 2);
}

Stack Trace:

  • mystery(5) = 5 + mystery(3)

  • mystery(3) = 3 + mystery(1)

  • mystery(1) = 1 (Base case)

  • Evaluation: $5 + (3 + 1) = 9$.


Key Takeaway for Exam Day

Whenever you see pointer and array combinations like *(*arr + 1) or *ptr++, immediately write down the memory addresses and variable pointers on your scrap paper. Dry-running beats guessing every time!

Topic Tags:#C Programming#Pointers#Recursion#Memory Traps#WBJEEB
PB

Written by ParikshaBangla Editorial Desk

Editorial Desk

WBJEEB Systems & C Programming Desk. Contributor to ParikshaBangla curriculum and diagnostic blueprints for West Bengal competitive exams.

Free Diagnostic Test

Test Your Knowledge with Official Negative Marking

Experience authentic timed exam conditions, digital OMR bubbling, and your All-Bengal rank.

Start Free Mock Test →

Recommended Next Reads

Strategy
WB JECA 2026 Preparation Strategy: 6-Month Complete Roadmap for BCA & BSc Graduates
8 min read
Syllabus & Weightage
WB JECA Marks Distribution & Subject Weightage: How to Target 85+ Marks
7 min read
Exam Traps
How to Master Category-2 Multi-Select Questions (MSQ) in WB JECA without Losing Marks
6 min read

Table of Contents

Why C Programming is the Deciding Factor in WB JECATrap 1: sizeof() Operator on Array vs Pointer ParameterTrap 2: Modification of String Literals vs Character ArraysTrap 3: Pointer Arithmetic and ScalingTrap 4: Recursive Function Return EvaluationKey Takeaway for Exam Day
Share with Aspirants
Target Merit List

Practice Official Pattern Questions

Solve subject-wise drills with detailed Bengali & English solutions verified by top rankers.

Start Subject Practice →
24/7 AI Doubt ResolutionMidnight concept & math tricks
Authentic OMR & CBT ModesPrintable A4 OMR and TCS iON CBT
All-Bengal Rank BenchmarkingStatewide merit benchmarking
Official Board PatternsExact negative marking rules
ParikshaBangla - Exams For A Stronger Bengal

West Bengal's #1 dedicated preparation platform for WBPRB Police, Kolkata Police, WBPSC Clerkship & Food SI, WBCS Executive, Primary TET, and WBJEEB Entrance examinations.

WhatsApp ChannelTelegram Channel
Helpline: +91 75508 14404 (10 AM - 7 PM)

Police & Defence Recruitment

  • WB Police Constable & Lady Constable
  • Kolkata Police (KP) Constable
  • WB Police Sub-Inspector (SI)
  • Kolkata Police Sub-Inspector (SI)
  • SSC GD Constable (Bengali)
  • WB Jail Warder
  • WBPSC Clerkship
  • WBPSC Food SI
  • WBCS (Executive) Prelims

Nursing, Teaching & Entrance

  • WB ANM & GNM Nursing
  • WB JENPAS UG (B.Sc Nursing)
  • JEXPO Polytechnic Entrance
  • WB Primary TET (Classes I–V)
  • WB Upper Primary TET
  • WB Panchayat Recruitment
  • WB JECA (MCA Entrance)
  • WBPSC Miscellaneous Services

Portal & Legal

  • Subscription Plans
  • Exam Alerts & Notices
  • Admit Card Downloads
  • Results & Cutoffs
  • Exam Dates & Calendar
  • AI Mastermoshai & FAQ
  • Exam Strategy Guides
  • বাংলা সংস্করণ (Bengali)
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy
West Bengal District Exam Guides

Select an exam to see its exam centres and PET grounds in each of the 23 districts:

WB Police Constable — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong
Kolkata Police (KP) — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong
WBPSC Clerkship — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong
WBPSC Food SI — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong
WBCS Prelims — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong
WB Primary TET — District Exam Guides:
Kolkata·North 24 Parganas·South 24 Parganas·Howrah·Hooghly·Nadia·Murshidabad·Purba Bardhaman·Paschim Bardhaman·Birbhum·Bankura·Purulia·Purba Medinipur·Paschim Medinipur·Jhargram·Malda·Uttar Dinajpur·Dakshin Dinajpur·Jalpaiguri·Alipurduar·Cooch Behar·Darjeeling·Kalimpong

© 2026 ParikshaBangla. All rights reserved. Dedicated to West Bengal competitive exams.

Privacy Policy·Terms·Refund Policy