PEC EPE Computer & Allied study materials
PEC EPE Computer & Allied study resources

PEC EPE Computer & Allied: Computer Fundamentals and Programming

PEC EPE Computer & Allied · Work through your exam, one topic at a time.

All guide sections

Computer Fundamentals and Programming

Computer Fundamentals and Programming tests how data is represented, how a program executes, and how to reason about code without a compiler. Expect number-system conversion, Boolean and bitwise operations, basic data structures, control flow, functions, memory, and elementary complexity.

Core rules

  • Integers use fixed width; overflow wraps in unsigned arithmetic and is undefined for signed in C.
  • Arrays are contiguous and zero-indexed; pointer arithmetic scales by element size.
  • Operator precedence: relational before logical AND/OR, but parentheses win.
  • Function arguments are passed by value in C; use pointers or references to mutate caller data.
  • Time complexity counts dominant growth, not constant factors.

Worked example

Trace int a[]={3,5,7}; int s=0; for(int i=0;i<3;i++) s += a[i]*2;. Iterations add 6, 10, and 14; final s=30. Complexity is O(n), not O(1): the loop touches each element once. If the loop were for(i=0;i<=3;i++), it would read beyond the array - undefined behavior, not a guaranteed zero.

Traps

Integer division truncates toward zero, so 7/2 is 3. Precedence mistakes such as a & b == 0 parse as a & (b==0), not (a&b)==0. Confusing logical && with bitwise & changes short-circuit behavior and results. Off-by-one errors at array bounds are undefined behavior. Recursion depth is not free; each call consumes stack.