Course Description
This course familiarizes students with basic principles of programming. It introduces structured programming paradigm using a high level language called C. It covers the concept of problem solving techniques, program design, and basic elements of C along with the detailed concept of operators, statements, arrays, functions, pointers, structures and file handling.
Course Objectives
The main objective of this course is to acquaint the students with good program design through structured programming paradigm for developing programs for specific tasks using C Programming Language as well as to present the syntax and semantics of the "C" language.
Course Contents
History and advantages of C; Problems analysis, algorithm and flowchart; Structure of a C Program; Writing, compiling, debugging, executing and testing a C Program in windows and Unix/Unix like environment
C Tokens; C Character Sets; Data types, Constants and Variables; Expression, statements and comments; Escape sequences and Delimiters
Conversion Specifiers; I/O functions; Formatted I/O
Arithmetic operators; Relational operators; Logical operators; Assignment operators; Type conversion in assignment; Increment and decrement operators; Ternary operator; Bitwise operator; Other operators (comma, sizeof); Expression evaluation; Operator precedence and associativity
Introduction to selection and iterative statements; GOTO and labels; Selection statements: if, if-else, if-else if ladder, nested if, switch case; Conditional operator; Iterative statements: For Loop, While Loop, Do while Loop, Nested Loop; The odd loop; Controlling the loop execution – break and continue
Introduction to Arrays; Initializing Arrays; The meaning of array indexing; One dimensional and Multidimensional Arrays; String and Basic functions dedicated to string manipulation
Introduction and types of functions; Declaring, Defining and calling functions; Arguments and Return Statement; Recursive functions; Function call by value and reference; Variables' scope, local variables and function parameters; Arrays as function parameter; Void as a parameter; Parameterizing the main function; External function and variables; Header files; Static variables; Register Variables
Features of C Preprocessor; Macro Expansion; Macros with Arguments; Macros versus Functions; File Inclusion; Conditional Compilation; #if and #elif Directives; #undef Directive; #pragma Directive; The Build Process; Compiling; Assembling; Linking; Loading
Introduction of Pointers, declaration and initialization of pointer variables; An address, a reference, a dereference and the sizeof operator; Pointer to nothing (NULL); Pointer assignment; Pointer Arithmetic; Pointer as argument and Pointer as return values; Pointers vs. arrays; Dynamic memory allocation
Definition of Structure; Array of structures; Passing structure and array of structure to function; Pointers to structures and arrays of structures; Self-referential structures; Typedef; Table Lookup; Unions
Files vs. streams; Header files needed for stream operations; Opening and closing a stream, open modes, error variable; Reading and writing to/from a stream; Predefined streams: stdin, stdout and stderr; Stream manipulation: fgetc(), fputc(), fgets() and fputs() functions; Raw input/output: fread() and fwrite() functions; Random access to files
Text / Reference Books:
1. Let Us C; Yashavant P. Kanetkar
2. Brian Kernighan and Dennis Ritchie, The C Programming Language
3. Byron Gottfried, Programming with C, Tata Hill Education