C programming: pointers, arrays and the 12 programs every exam asks
C is the first language for most engineering students and the first place they get stuck. Here is what the paper actually wants.
Study Delight Publications, Delhi

C is on every engineering syllabus for a reason: it teaches what the computer is really doing. It is also where most first-years lose marks, because the paper tests three things most tutorials skip — memory, pointers and output tracing.
What the C paper is made of
-
Output questions (20–30%) — "What is the output of the following code?" Usually about
++ivsi++, integer division,printfformat specifiers and pointer arithmetic. - Write-a-program questions (30–40%) — the same dozen programs rotate every year (list below).
-
Theory (30%) — storage classes, call by value vs reference, structures vs unions,
mallocvscalloc.
Pointers in one paragraph
A pointer is a variable that stores an address. int *p = &x; means "p holds where x lives". *p reads or writes the value at that address. Arrays are pointers in disguise: a[i] is exactly *(a + i). Once that clicks, strings (char *), passing arrays to functions and dynamic memory all become the same idea.
#include <stdio.h>
int main() {
int a[] = {10, 20, 30};
int *p = a;
printf("%d %d\n", *p, *(p + 2)); // 10 30
p++;
printf("%d\n", *p); // 20
return 0;
}
The 12 programs that keep coming back
- Reverse a number / check palindrome
- Prime numbers in a range
- Factorial and Fibonacci (loop and recursion — both get asked)
- Armstrong number
- Swap two numbers using pointers (call by reference)
- Largest element in an array
- Bubble sort
- Linear and binary search
- Matrix addition and multiplication
- String reverse / palindrome without
strrev - Count vowels, words and characters in a string
- Student record with a
structand an array of structures
Three mistakes that cost the most marks
- Forgetting
&inscanf("%d", &n);— it compiles, then crashes. -
5 / 2is2, not2.5. Make one operand a float. - Writing
if (x = 5)instead ofif (x == 5)— always true, always wrong.
How to revise C in a week
Days 1–2: basics, operators, control flow, and tracing output by hand. Days 3–4: arrays, strings, functions. Day 5: pointers (the whole day). Day 6: structures, files, dynamic memory. Day 7: write the 12 programs from memory, no book open.