NBC 1034 CreditsSemester 1 • VBSPU
Problem Solving Using C
External Exam70 Marks
Internal / TA30 Marks
Total Scope5 Units
Passing Marks40% Minimum
🎯 "Kaise Padhna Hai" — Scoring Strategy (Target: 85%+)
🔥 High-Yield Scoring Units: Units 1, 2, 3, 4, 5
- In Unit 1, always draw the complete 4-Stage Compilation Pipeline (.c -> Preprocessor -> .i -> Compiler -> .s -> Assembler -> .o -> Linker -> .exe) and standard flowchart symbols with directional flowlines.
- In Unit 2 loop questions, always write down the 4 mandatory loop components (Initialization, Test Condition, Body, Update) and compare while vs do-while with execution flowcharts.
- In Unit 3, draw RAM memory block diagrams showing pointer addresses (e.g. 0x1000, 0x1004) and demonstrate the Equivalence Principle: *(arr + i) == arr[i].
- For Structure vs Union questions (Unit 4), always draw the memory overlap diagram showing separate member memory vs single shared largest-member block.
- In Dynamic Memory Allocation (Unit 5), always include the defensive check: if (ptr == NULL) and explicitly show free(ptr) followed by ptr = NULL.
- In File Handling questions, always explain the 6 access modes ('r', 'w', 'a', 'r+', 'w+', 'a+') and write out the fseek() syntax with SEEK_SET, SEEK_CUR, and SEEK_END.
- Include a working 5-10 line C code snippet with standard int main(void) and return 0 for every theoretical question.
Common Mistakes to Avoid in Exam:
- • Using the address-of operator (&) on a string character array in scanf("%s", &str) — array name 'str' already decays into the base address &str[0]!
- • Writing if (x = 5) instead of relational equality if (x == 5) — assignment always evaluates to true (non-zero) and silently overwrites x.
- • Omitting the base condition in recursive functions, causing continuous stack frame allocation and catastrophic Stack Overflow (Segmentation Fault).
- • Using floating-point expressions in switch-case statements — C strictly requires integer or character constant expressions.
- • Forgetting to call free(ptr) and leaving Dangling Pointers by not setting ptr = NULL after dynamic deallocation.
- • Omitting parentheses in pointer-to-structure member access: *ptr.member is interpreted as *(ptr.member), which fails. Always use (*ptr).member or ptr->member.
Complete Unit-wise Syllabus & Notes (Units 1 to 5)
Problem Solving Concepts, Algorithms & Flowcharts
14 min readHigh Exam Frequency
C History, Program Architecture & Compilation Pipeline
15 min readHigh Exam Frequency
C Tokens, Keywords, Identifiers & Primitive Data Types
15 min readHigh Exam Frequency
Constants, Variables, Type Casting & Operator Hierarchy
16 min readHigh Exam Frequency
Formatted & Unformatted Input/Output (I/O) Operations
14 min readHigh Exam Frequency
NBC 103 Self-Check Quiz
Test your mastery of core exam concepts
1.Which of the following is an exit-controlled loop in C?
2.What does the expression sizeof(char) return according to the ANSI C standard?
3.What happens if dynamic memory allocated with malloc() is never released with free()?
4.What is the worst-case time complexity of Binary Search on an array of N elements?
5.Which storage class preserves a variable's state between successive function invocations?
6.Why cannot the address-of operator (&) be applied to a variable declared with the 'register' storage class?
7.How is the total memory size of a Union determined in C?
8.What does fopen("data.txt", "w") do if the file 'data.txt' already exists on disk?
9.What is the result of the equivalence principle expression *(arr + i) in C?
10.What is the primary difference between malloc() and calloc() in <stdlib.h>?
Top Viva Voce Questions for NBC 103
1
What is the key difference between an Algorithm and Pseudocode?
2
Why can a flowchart have multiple STOP symbols but strictly only ONE START symbol?
3
What is the difference between Linker and Loader?
4
Why is 'void main()' considered obsolete or bad practice in modern ANSI C?
5
What happens when an unsigned char exceeds its maximum value of 255?
6
Can an identifier in C begin with an underscore (_)?
7
What is the output of printf("%d", 5 / 2) vs printf("%f", 5.0 / 2)?
8
What is the difference between #define PI 3.14 and const float PI = 3.14?
9
Why should we never use gets() in production C code?
10
What does the return value of scanf() represent?
11
Can we use relational conditions like 'case > 5:' in a C switch statement?
12
What is the Dangling Else problem and how does the C compiler resolve it?
13
What is the output of: int i = 10; do { printf("%d ", i); i++; } while(i < 5);?
14
Can any expression in a for loop header: for(e1; e2; e3) be omitted?
15
Can continue be used inside a switch statement?
16
What is the difference between return 0 and exit(0)?
17
What happens if you call a function before its declaration in C?
18
Can a C function return multiple values directly?
19
Why does C not have true Call by Reference like C++?
20
What is Tail Recursion and why is it desirable?
21
Why does C not check array bounds during runtime?
22
What is the difference between int arr[5] and arr[5]?
23
Why must the column size be specified when declaring 2D arrays as function parameters: void func(int arr[][3])?
24
What is the Transpose of a matrix?
25
What is the size of a pointer variable in C?
26
What is a Dangling Pointer and how do you remediate it?
27
Why does sizeof(arr) behave differently inside main() versus inside a function receiving arr?
28
What is a Function Pointer?
29
What is the ASCII value of the null character '\0' versus character '0'?
30
What happens if a character array has no '\0' terminator?
31
Can two different structure types contain members with identical names?
32
What is the purpose of #pragma pack(1)?
33
What is the syntactic difference between (*ptr).member and *ptr.member?
34
Can a structure contain an instance of itself as a member?
35
Can we use the address-of operator (&) on a bit-field member?
36
What is the memory address of the first member of a union compared to the union variable itself?
37
Does typedef allocate any physical memory in RAM?
38
Can an enum value in C be negative?
39
Why does the compiler ignore the 'register' keyword sometimes?
40
What is the difference between declaring a variable with extern versus defining it?
41
Why is Binary Search inefficient on standard Singly Linked Lists?
42
How many comparisons does Binary Search take in an array of 1024 elements in the worst case?
43
What is an In-Place Sorting Algorithm?
44
Why is Selection Sort not considered stable?
45
What does malloc(0) return in C?
46
Can memory allocated with malloc() be freed partially?
47
Why is the return type of fgetc() int rather than char?
48
What is EOF and what numerical value does it hold?
49
What is the return value of fread() and fwrite()?
50