C Programming - Syllabus

Embark on a profound academic exploration as you delve into the C Programming course (C) within the distinguished Tribhuvan university's BIT department. Aligned with the BIT Curriculum, this course (BIT102) seamlessly merges theoretical frameworks with practical sessions, ensuring a comprehensive understanding of the subject. Rigorous assessment based on a 60 + 20 + 20 marks system, coupled with a challenging passing threshold of , propels students to strive for excellence, fostering a deeper grasp of the course content.

This 3 credit-hour journey unfolds as a holistic learning experience, bridging theory and application. Beyond theoretical comprehension, students actively engage in practical sessions, acquiring valuable skills for real-world scenarios. Immerse yourself in this well-structured course, where each element, from the course description to interactive sessions, is meticulously crafted to shape a well-rounded and insightful academic experience.


 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 Objective:

The main objective of this course is to acquaint the students with good program design through

structured programming paradigm for developing program for specific tasks using C Programming

Language as well as to present the syntax and semantics of the C language

Units

Introduction

History and Advantages of C, Problems Analysis, Algorithm and Flowchart (introduction and characteristics of algorithm, introduction and symbols of flowchart start/stop, read/print, processing statement, condition check, direction of flow), Structure of a C Program (preprocessor directive, #include and #define directives, header files and library files); Writing, compiling, Debugging, Executing and Testing a C Program in windows and Linux/Unix like environment (compiler, integrated development environment, compiling and linking, compiler error, linker error, and run-time error)


Elements of C

C Tokens (keywords, identifiers, operators, constants, and special symbols); C Character Sets (letters, digits, special characters and white spaces); Data types (Basic, Derived, and User Defined), Constants and Variables; Expression, Statements and Comments; Escape sequences and Delimiters


Input/Output function

Conversion Specifiers; I/O functions; Formatted and Unformatted I/O (sacanf, printf, getchar, putchar, getch, getche, gets, puts, putch, getc, putc)


Operators and Expression

 Arithmetic operators; Relational operators; Logical operators; Assignment operators; Type conversion in assignment; Increment and decrement operators Ternary operator (conditional operator); Bitwise operator; Other operators (comma, sizeof); Expression evaluation (implicit and explicit type conversion; Operator precedence and associatively)


Arrays and Strings

Introduction to Arrays; Initializing Arrays; The meaning of array indexing; One dimensional and Multidimensional Arrays (two dimensional only); String and Basic functions dedicated to string manipulation (reading and writing strings, null character, strcpy, strcmp, strcat, strlen, strupr, strlwr, strrev)


Control Structures

Introduction control statements, Selection statements: if, if..else, if..else if ladder, nested if, switch case; break and continue, goto and labels Iterative statement: For Loop, While Loop, Do while Loop, Nested Loop; The odd loop; Controlling the loop execution, Exit statement


Functions

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


The C Preprocessor

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; Preprocessing; Compiling; Assembling; Linking; Loading


Pointers

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


Structure and Unions

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


File Handling

Files vs. streams; Header files needed for stream operations; Opening and closing a stream, open modes, errno 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


Lab works