Programming in C
Semester I · BCA 102 · 3 credits
0 / 7
chapters done
-
The syllabus asks for
- Program, programming language and its levels
- Problem solving: from a statement to a program
- Algorithms
- Flowcharts
- History and character of C
- Structure of a C program
- Edit, compile, link, run
- Errors and debugging
Key points
- Think in algorithms first; trace on paper; then code.
- Pseudocode is exact English, flowcharts are exact pictures; neither depends on a language.
- C is compiled, portable, close to hardware and the basis of Unix, Linux and most system software.
- A C program is directives, then main, then other functions; statements end in ;.
- gcc -Wall and read every warning. A program that compiles can still be wrong: test and debug.
-
The syllabus asks for
- Character set and tokens
- Data types
- Variables and constants
- Operators
- Formatted output with printf
- Input with scanf, getchar, gets-family
- Eight common mistakes with data types, operators and input/output
Key points
- Tokens are keywords, identifiers, constants, strings, operators, punctuators.
- Pick the type by the range you need; integer arithmetic truncates, so cast before dividing when you want a real result.
- Precedence rules decide grouping; parentheses remove doubt. Never modify one variable twice in an expression.
- printf formats, scanf parses; check scanf's return value and prefer fgets for lines.
-
The syllabus asks for
- Decision making
- The switch statement
- Loops
- break, continue, goto
- Eight uses of loops and decisions in real programs
Key points
- Decide with if/else if/switch; repeat with for/while/do-while.
- Trace loops in a table; count iterations by hand before running.
- break exits, continue skips, goto is a last resort.
- The commonest bugs are = for ==, an accidental ; after for/if, missing break, and floating-point loop counters.
-
The syllabus asks for
- One-dimensional arrays
- Searching and sorting
- Two-dimensional arrays
- Strings
- Eight uses of arrays and strings
Key points
- Arrays: same type, contiguous, zero-based, unchecked.
- Master four loops over arrays: scan, search, swap-based sort, nested matrix loops.
- Strings are char arrays ended by '\0'; the library functions all depend on it.
- Overflowing an array or a string buffer is the most common serious C bug.
-
The syllabus asks for
- Defining and calling
- Parameter passing
- Recursion
- Scope and storage classes
- Eight advantages of using functions
Key points
- Write small functions with one purpose and a prototype.
- Remember copies are passed; use pointers for output parameters.
- Recursion needs a base case; know the cost.
- Know where each variable lives and how long it lasts.
-
The syllabus asks for
- Addresses, pointers and the two operators
- Pointer arithmetic
- Pointers and strings
- Pointers and functions
- Dynamic memory allocation
- Eight uses of pointers
Key points
- A pointer is an address with a type; * follows it, & makes it.
- Array indexing is pointer arithmetic in disguise.
- Strings are char sequences handled by pointer; arrays of pointers store ragged lists.
- The heap gives size flexibility at the price of discipline: allocate, check, use, free.
-
The syllabus asks for
- Structures
- Unions and enumerations
- The preprocessor in brief
- Files
- Eight uses of structures, unions and files
Key points
- A structure groups different types into one record; arrays of structures are tables.
- A union overlays members in one block; an enum names integers.
- Preprocessor lines run before compilation; parenthesise macros.
- Files make data permanent: open, check, read or write, close; binary files plus fseek give random access.
No chapter matches. Try another word.
The paper
TU assessment: 60% final examination set by the university, 40% internal (assignments, lab work, attendance). Confirm the split in your college's notice.
Where the hours go
Teaching hours are the board's guide to how much of the paper each part carries.
- Unit 7 · Structures, Unions and File Handling9 h
- Unit 2 · Elements of C: Tokens, Data Types, Operators and Console Input/Output8 h
- Unit 4 · Arrays and Strings8 h
- Unit 3 · Control Statements: Decisions, Loops and Jumps7 h
- Unit 5 · Functions, Recursion and Storage Classes6 h
- Unit 6 · Pointers and Dynamic Memory Allocation6 h
- Unit 1 · Problem Solving with a Computer, and the Shape of a C Program4 h