csc115

C Programming

Exam Preparation: 25 hours
Deep Understanding: 70 hours
Subject Code CSC 115
Credit Hours 3 Hours
Nature Theory + Lab
Full Marks 60 + 20 + 20
Pass Marks 24 + 8 + 8
Description

This course covers the concepts of structured programming using C programming language.

Objective

This course is designed to familiarize students to the techniques of programming in C.

Course Contents

Problem Solving with Computer

2 Hours

Problem analysis, Algorithms and Flowchart, Coding, Compilation and Execution, History of C, Structure of C program, Debugging, Testing and Documentation

Elements of C

4 Hours

C Standards (ANSI C and C99), C Character Set, C Tokens, 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

Input and Output

2 Hours

Conversion specification, Reading a character, Writing a character, I/O operations, Formatted I/O

Operators and Expression

4 Hours

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, Operator Precedence and Associativity

Control Statement

4 Hours

Conditional Statements, Decision Making and Branching, Decision Making and Looping, Exit function, Break and Continue

Arrays

6 Hours

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)

Functions

5 Hours

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

Structure and Union

5 Hours

Introduction, Array of structure, Passing structure to function, Passing array of structure to function, Structure within structure (Nested Structure), Union, Pointer to structure

Pointers

6 Hours

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

File Handling in C

4 Hours

Concept of File, Opening and closing of File, Input Output Operations in File, Random access in File, Error Handling in Files

Introduction to Graphics

3 Hours

Concepts of Graphics, Graphics Initialization and Modes, Graphics Function

Laboratory Works

This course requires a lot of programming practices. Each topic must be followed by a practical session. Some practical sessions include programming to: Create, compile and run simple C programs; handle different data types available in C; perform arithmetic operations in C; perform formatted input and output operations; perform character input and output operations; perform logical operations; create decision making programs; create loops to repeat task; create user-defined functions; create recursive functions; work with automatic, global and static variables; create and manipulate arrays and matrices (single and multi-dimensional); work with pointers; dynamically allocate and de-allocate storage space during runtime; manipulate strings (character arrays) using various string handling functions; create and use structures and files to keep record of students, employees etc.

Books

Textbooks

Byron Gottfried: Programming with C, Second Edition, McGraw Hill Education
Herbert Schildt: C The Complete Reference, Fourth Edition, Osborne/McGraw-Hill Publication

Reference Books

Paul Deitel, Harvey Deitel: C: How to Program, Eighth Edition, Pearson Publication
Al Kelley, Ira Pohl: A Book on C, Fourth Edition, Pearson Education
Brian W. Kernighan, Dennis M. Ritchie: The C Programming Language, Second Edition, PHI Publication
Ajay Mittal: Programming in C: A Practical Approach, Pearson Publication
Stephen G. Kochan: Programming in C, CBS Publishers & Distributors
E. Balagurusamy: Programming in ANSI C, Third Edition, TMH Publishing