Programming in C
- Semester
- 1
- Credits
- 6
- Course type
- MAJ-1
- Theory / Practical
- Combined
- L–P–Tu ?
- 4-2-0LecturePracticalTutorial
Course objective
Course Objectives: Introduce the fundamental concepts and principles of C programming language. Develop students' ability to design, implement, and debug C programs. Familiarize students with essential programming constructs, such as variables, control structures, and functions. Provide a foundation for problem-solving and algorithm development through practical programming exercises.
Learning outcome
Course Outcomes: Demonstrate a comprehensive understanding of the basic syntax, data types, and operators in the C programming language. Apply problem-solving strategies to develop algorithms and implement them as C programs. Analyze and debug C programs to identify and rectify errors, ensuring program correctness and efficiency. Develop proficiency in utilizing fundamental programming constructs, such as loops, conditionals, and functions, to solve real-world problems.
Full syllabus
Syllabus:
Theory Credit: 4 (L 60)
Introduction: Problem Analysis, need for programming languages, overview of C language, Basic Structure, Character sets, Keywords, Identifiers, Constants, Variables, Data types (Data types – primitive and non-primitive). [L 4]
Operators: Arithmetic, Relational, Logical and Assignment; Increment, Decrement and Conditional, Operator Precedence and Associativity; Expressions, Expression evaluation and type conversion, casts, Formatted input and output. [L 4]
Statements: Assignment, Initialization, Decision making, looping and control structure. [L 5]
Array: One-Dimensional Arrays and Initialization, Two-Dimensional Arrays and Initialization, Accessing array elements, Character Arrays and Initialization, Introduction to Multi-Dimensional Arrays. [L 8]
String and String handling function: String declaration, Initialization and accessing, Array of Strings, String functions. [L 6]
Pointers: Declaration and initialization, accessing variables through pointer, Pointer arithmetic, Pointers and arrays, Dynamic Storage Allocation, Problems with Pointers. [L 5]
Functions: General form of a Function, Function Declaration and Definition, Function Arguments (Call by Value and Call by Reference), Arguments to main() (argc and argv), Returning from a Function, Functions Returning Values and their types, Function Returning Pointers, Functions of Type void, Declaring Variable-Length Parameter Lists, Passing pointer to function, Passing One-Dimensional Arrays to Functions, Passing Two-Dimensional Arrays to Functions, Recursion, Library Functions. [L 10]
Derived Data Types (Structures and Unions): Basics of Structures, Accessing Structure Members, Structure Assignments, Array of Structures, Pointers to Structures, Passing Structures to Functions, Nested Structures, Self-Referential Structures, Bit-Fields, Unions, typedef. [L 8]
Memory Allocation in C: Static and Dynamic Memory Allocation, C’s Dynamic Allocation Functions (malloc(), calloc(), free()). [L 6]
File I/O and Pre-processor Directives: Opening and Closing a File, Reading and Writing Text Files, Random Access in Files, Pre-processor Directives, Macros. [L 4]
Computer Programming and Numerical Methods Lab (Using C) Credit: 2 (L 60)
- Practical part of Programming in C will be based upon the modules covered in the theory part.
- Numerical problem solutions like Round Off Error, Bisection Method, Newton Raphson Method, Interpolation (Forward, Backward).
Reading References
- B. S. Gottfried, Programming in C (Sahaum Series).
- Balaguruswami, Programming in ANSI C- E (TMH).
- B. W. Kernighan and D. M. Ritchie, The C Programming Language, PHI.
- H. Schildt, C Made Easy, Osborne McGraw-Hill.
- Pradip Dey, Manas Ghosh, Computer Fundamentals and Programming in C, Second Edition, Oxford University Press.
- Ajay Mittal, Programming in C: A Practical Approach, Pearson Publication.