C Programming

This course covers the concepts of structured programming using C programming language.This course is designed to familiarize students to the techniques of programming in C.

Course Content

Unit 1: Problem Solving with Computer

This unit contains following topics: Problem analysis (requirement analysis, program design, program coding, program testing, software installation and maintenance ), Algorithms and Flowchart (symbols start/stop, read/print, processing statement, condition check, direction of flow, connectors), Coding, Compilation and Execution (compiler, integrated development environment, compiling and linking ), History of C, Structure of C program (preprocessor directive, #include and #define directives, header files and library files), Debugging, Testing and Documentation (compiler error, linker error, and run-time error).

Unit 2: Elements of C

This unit contains following topics. C Standards( ANSI C and C99), C Character Set (letters, digits, special characters and white spaces), C Tokens (keywords, identifiers, operators, constants, and special symbols), Escape sequence, Delimiters, Variables, Data types (Basic, Derived, and User Defined), Structure of a C program, Executing a C program, Constants/ Literals, Expressions, Statements and Comments.

Unit 3: Input and Output

This unit contains following topics: Conversion specification, Reading a character, Writing a character, I/O operations, Formatted I/O.

Unit 4: Operators and Expression

This unit contains following topics: Arithmetic operator, Relational operator, Logical or Boolean operator, Assignment Operator, Ternary operator, Bitwise operator, Increment or Decrement operator, Conditional operator, Special Operators( sizeof and comma), Evaluation of Expression (implicit and explicit type conversion), Operator Precedence and Associativity.

Unit 5: Control Statement

This unit contains following topics: Conditional Statements, Decision Making and Branching (if, if else, nested if else, else if ladder, and switch statements), Decision Making and Looping (for, while, and do while loops), Exit function, Break and Continue.

Unit 6: Arrays

This unit contains following topics: Introduction to Array, Types of Array (Single Dimensional and Multidimensional), Declaration and Memory Representation of Array, Initialization of array, Character Array and Strings, Reading and Writing Strings, Null Character, String Library Functions( string length, string copy, string concatenation, string compare).

Unit 7: Functions

This unit contains following topics: Library Functions, User defined functions, Function prototype, Function call, and Function Definition, Nested and Recursive Function, Function Arguments and Return Types, Passing Arrays to Function, Passing Strings to Function, Passing Arguments by Value, Passing Arguments by Address, Scope visibility and lifetime of a variable, Local and Global Variable.

Unit 8: Structure and Union

This unit contains following topics: Introduction, Array of structure, Passing structure to function, Passing array of structure to function, Structure within structure ( Nested Structure), Union, Pointer to structure.

Unit 9: Pointers

This unit contains following topics: Introduction, The & and * operator, Declaration of pointer, Chain of Pointers, Pointer Arithmetic, Pointers and Arrays, Pointers and Character Strings, Array of Pointers, Pointers as Function Arguments, Function Returning pointers, Pointers and Structures, Dynamic Memory Allocation.

Unit 10: File Handling in C

This unit contains following topics: Concept of File, Opening and closing of File (naming, opening, and closing a file), Input Output Operations in File (reading data from file, writing data to a file), Random access in File (ftell(), fseek(), rewind()) Error Handling in Files (feof(), ferror()) (Note: address some of the functions associated with file handling, e.g. fopen(), fclose(), fgetc(), fputc(), fprintf(), fscanf()).

Unit 11: Introduction to Graphics

This unit contains following topics: Concepts of Graphics (graphics.h header file), Graphics Initialization and Modes (graphics driver and graphics mode), Graphics Function (Basic functions of graphics.h e.g. line(), arc(), circle(), ellipse(), floodfill(), getmaxx(), getmaxy()).