L 3 C 3
Teachers Continuous Evaluation: 40 marks. Term-End Semester Examination: 60 marks.
Course outcomes
- Develop structured C programs using fundamental programming constructs, data types, operators, expressions, control structures, and standard input/output techniques to solve computational problems.
- Design modular C programs using functions, arrays, strings, storage classes, header files, recursion, and standard library functions for implementing searching, sorting, and numerical algorithms.
- Develop efficient C programs employing structures, unions, enumerations, pointers, dynamic memory allocation, file handling, and command-line arguments for solving engineering applications involving complex data.
- Design and implement Abstract Data Types (ADTs) and fundamental data structures using C, including linked lists, stacks, queues, and trees, while applying function pointers, generic programming concepts, and modern C programming practices for robust software development.
Unit I
Structure of a C program, Basic data types (int, char, float, double, bool, fixed-width integers), Declarations and initializations, Constants using const and #define, Operators and expressions (arithmetic, relational, logical, bitwise, assignment, conditional, increment/decrement), Type conversions (implicit, explicit casting), Input/output (printf, scanf, format specifiers), Compound statements (blocks), Conditional statements (if, if-else, else-if, switch), Loops (while, do- while, for, infinite loops, early exit), break, continue, goto, return, Algorithm development including flowcharts, pseudocode representation, Tracing and dry run, structured programming. C89, C99, C11 and C23 extensions and usage
Unit II
Function declaration, definition, and invocation, Argument passing (by value, recursion), Inline functions and macro functions, Storage classes (auto, static, extern, register, thread_local), Scope and lifetime of variables, Header files and modular program design, One- and two-dimensional arrays (declaration, access, memory layout), Bubble sort, selection sort, insertion sort, linear and binary search, String input/output (gets, puts, fgets, fputs), Standard string manipulation (strlen, strcpy, strcat, strcmp, etc.), Arrays of strings, Command-line arguments. Root finding of a positive floating point number.
Unit III
Structures (struct definition, nested structures, array of structures, pointer to structures), Unions (union, use-cases, memory layout), Enumerated types (enum, typedef enum), Bit fields, Memory layout and alignment, Pointers (declaration, dereferencing, pointer arithmetic, arrays vs pointers, pointer to pointer), Dynamic memory allocation (malloc, calloc, realloc, free), Memory leak prevention, NULL and null pointer checks, Compound literals, Representation and Arithmetic on polynomials with floating point coefficients. Matrices and arithmetic operations on them (addition, subtraction and multiplication). File I/O (opening, closing, reading, writing text and binary files, fopen, fclose, fprintf, fscanf, fread, fwrite, fgets, fputs), Error handling using errno, Command-line parameters
Unit IV
Abstract Data Types (ADTs), Singly and doubly linked lists , Stack (array and linked list implementation), Infix-to-postfix conversion, Parenthesis balancing, Queue (linear, circular, priority) (array and linked list implementation), Traversal, insertion, deletion in lists, Binary tree basics (creation, inorder, preorder, postorder traversal), Function pointers, Pointers to arrays and functions, Idea of Generic code using macros, _Generic for type-generic programming, Assertions and diagnostics (assert, _Static_assert), Safer macros and expressions, Forward declaration, Program segmentation, Header hygiene, recursion.
Textbooks
- B. W. Kernighan and D. M. Ritchie, The C Programming Language, 2nd Edition, Pearson Education, 1988.
- Jens Gustedt, Modern C, 2nd Edition, O'Reilly Media, 2025.
- ISO/IEC 9899:2024, Information Technology — Programming Languages — C, 5th Edition, International Organization for Standardization (ISO), 2024.
References
- Modern C, Zoran Pavlovic, Manning Publications, 2020
- 21st Century C, Ben Klemens, O’Reilly Media, 2014
- C: How to Program, Paul Deitel and Harvey Deitel, 8th Edition, Pearson, 2016
- Engineering Problem Solving With C, Delores M. Etter, Pearson, 2013.
- Problem Solving and Program Design in C, Jeri R. Hanly and Elliot B. Koffman, Pearson, 2016.
- C Programming: A Modern Approach, K. N. King, W. W. Norton, 2008
- MIT 6.087 Course Notes, Practical C Programming