NEB 12 Computer Science common mistakes
NEB 12 Computer Science · Understand the traps and how to avoid them.
Writing a C program that omits the header files or declares main as void, then expecting full marks for the 'structure of a C program' question.
Candidates memorize the body of a program (declarations, statements, return) but skip the preprocessor directives and the int return type because those lines feel like boilerplate that 'doesn't do anything'.
What to do instead
Memorize a fixed skeleton - #include <stdio.h>, int main(), braces, return 0; - and write it out first for every coding answer before filling in logic. Practise writing three complete programs from a blank page each week so the skeleton becomes automatic.
Confusing the assignment operator = with the equality operator == inside if conditions and while loops.
In mathematics '=' means equality, so the habit transfers. In C, if (x = 5) is legal and always true, so the program compiles and runs, hiding the error from the candidate.
What to do instead
Before submitting, scan every if/while/for condition for a single '='. Read conditions aloud as 'is equal to' when you see ==. Write comparison conditions with the constant on the left where possible, e.g. if (5 == x), so a typo becomes a compile error rather than silent logic.
Describing a for loop or while loop in prose without stating the initialization, condition, and update steps, or writing a loop that never terminates because the update is missing.
Candidates can trace a given loop but cannot construct one from a specification, and they forget that the loop variable must change inside the body for a while loop.
What to do instead
For every loop question, explicitly label the three parts: initialization, test condition, and update/increment. Trace the loop by hand for the first three iterations in a table of variable values. If a loop answer has no statement that changes the control variable, treat it as wrong and fix it before moving on.
Mixing up the relational and logical operators, e.g. writing 0 < x < 10 to mean 'x is between 0 and 10', or using & instead of &&.
Mathematical notation and everyday English ('and') suggest a chained comparison, and the single & looks like a valid 'and'. In C, 0 < x < 10 evaluates (0 < x) first, giving 0 or 1, which is then always less than 10.
What to do instead
Write range checks as two separate comparisons joined by &&: x > 0 && x < 10. Keep a one-line operator table (== != < <= > >= && || !) in your notes and drill ten truth-value evaluations per study session, evaluating each sub-expression to 0 or 1 before combining.
Tracing a program containing a function call and losing track of the difference between actual arguments and formal parameters, or failing to state the returned value.
Candidates read functions top to bottom and treat parameters as global variables, so they cannot follow the flow of control from the caller into the function and back.
What to do instead
Trace with a call stack: write the caller's argument values, jump to the function, list the formal parameters with those values, execute line by line, then write the return value back at the call site. Do this on paper for recursive and non-recursive examples until the pattern is automatic.
Describing arrays as 'a list of variables' and then writing code that uses 1-based indexing, e.g. accessing a[1] as the first element or looping to i <= n for an n-element array.
Everyday counting starts at 1 and the candidate's mental model of 'first item' is position 1, while C arrays start at index 0 and the last valid index is n-1.
What to do instead
State the definition precisely: a collection of elements of the same data type stored in contiguous memory locations, accessed by a single name and an index starting at 0. For every array loop, write the bounds as i = 0; i < n; i++ and check the last iteration gives index n-1.
Giving a vague definition of DBMS or data abstraction, or listing normalization forms without explaining what redundancy or update anomaly each one removes.
These are definition-heavy topics where candidates memorize a phrase from a textbook without understanding the purpose, so they cannot answer the 'why' or 'explain with an example' part of the question.
What to do instead
For each database concept, prepare a three-part answer: definition in one sentence, the problem it solves, and a two-row example. For normalization, be able to show an unnormalized table and state exactly which anomaly (insertion, deletion, update) each normal form prevents.
Answering networking questions with a list of protocol names but no mapping to the TCP/IP or OSI layer, or confusing a hub with a switch and a router.
Candidates memorize acronyms (TCP, IP, HTTP, FTP) without placing them in a layered model, and device names feel interchangeable because they all 'connect computers'.
What to do instead
Build a layer table with the layer name, its function, the protocols at that layer, and the device (hub at physical, switch at data link, router at network). Answer every networking question by naming the layer first, then the protocol or device.
Converting between number systems by writing the decimal answer only, or making a place-value error in binary-to-decimal and hexadecimal conversions.
Candidates do the conversion mentally without showing place values, so a single slip in a power of two or a hex digit A-F goes undetected.
What to do instead
Always write the place-value row above the digits (128 64 32 16 8 4 2 1 for a byte) and add the weights of the 1-bits. Memorize the hex-to-binary nibble table (A=1010 through F=1111). Verify by converting back in the opposite direction before finalizing.
Writing a full answer for a 'short note' or 'differentiate' question in paragraph form, or answering only one half of a two-part question such as 'define X and give an example'.
Candidates read the first verb and start writing, and under time pressure they miss the second instruction or the marks allocation shown in the margin.
What to do instead
Before writing, underline every command word in the question (define, differentiate, give an example, list two) and number them in the margin. Allocate answer length by marks: a 2-mark question gets two precise points, not a paragraph. For 'differentiate', always use a two-column table with paired points.