Bachelors Level/First Year/First Semester/Science bit/first semester/c programming/syllabus

Bachelors In Information Technology

Institute of Science and Technology, TU

Nature of the course: (Theory+Lab)

F.M: 60+20+20 P.M: 24+8+8

Credit Hrs: 3Hrs

C Programming [BIT102]
Course Objective
i.
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.
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.

S1:Introduction[3]
1
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)
S2:Elements of C[3]
1
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
S3:Input/output Functions[2]
1
Conversion Specifiers; I/O functions; Formatted and Unformatted I/O (sacanf, printf, getchar, putchar, getch, getche, gets, puts, putch, getc, putc)
S4:Operators and Expressions[4]
1
Arithmetic operators; Relational operators; Logical operators; Assignment operators; Type conversion in assignment; Increment and decrement operators;
2
Ternary operator (conditional operator); Bitwise operator; Other operators (comma, sizeof); Expression evaluation (implicit and explicit type conversion; Operator precedence and associatively)
S5:Control Structures[8]
1
Introduction control statements, Selection statements: if, if..else, if..else if ladder, nested if, switch case; break and continue, goto and labels
2
Iterative statement: For Loop, While Loop, Do while Loop, Nested Loop; The odd loop; Controlling the loop execution, Exit statement
S6:Arrays and Strings[5]
1
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)
S7:Functions[6]
1
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
S8:The C Preprocessor[2]
1
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
S9:Pointers[5]
1
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 allocationIntroduction 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
S10:Structure and Unions[5]
1
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
S11:File Handling[2]
1
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
References
1.
Let Us C, Yashavant P. Kanetkar
2.
Brian Kernighan and Dennis Ritchie, The C Programming Language
3.
Byron Gottfried, Programming with C, McGraw Hill Education
Labrotary Work
Unit 1,2,3,4
1.
Using different data types available in C, perform arithmetic operations in C, perform formatted and unformatted input/output operations, perform character input/output operations.
2.
Using relational operator, logical operator, assignment operator, ternary operator, and other operators. Evaluation of Expression to check operator precedence and associatively.
Unit 5
1.
Create decision making programs using control statements like; if, if..else, if..else ladder, nested if, and switch cases.
2.
Create programs using loops (for, while, do while, nested loops) and realize the differences between entry controlled and exit controlled loops.
Unit 6
Unit 7
1.
Create user-defined functions with/without parameters or return type, create recursive functions, use function call by value and call by address, work with automatic, global and static variables.
Unit 8
1.
Create programs to address macro, file inclusion, conditional compilation (#if, #ifdef, #endif, #ifndef, #else, #elif), building process
Unit 9
1.
Create programs that addresses pointer arithmetic, pointers and arrays, pointer and character strings, pointers and functions, pointer and structure, and dynamic memory allocation.
Unit 10
Unit 11
1.
Create files that address random access and input/output operations in file, create files to keep records and manipulation of records etc.