⚠️ **DISCLAIMER:** This syllabus copy is provided for reference only. Please verify with the official university website for the most current curriculum.
Computer Programming (1AS003ES)
**Course Aim:** To comprehend fundamental concepts of C Programming, develop problem-solving skills, manipulate data using arrays/strings, and manage complex data structures.
Unit I: C Fundamentals (7 Hrs)
Introduction, Importance of C, Basic Structure of C Program, Executing a C Program, Character Set, C Tokens, Keywords, Identifiers, Constants and Variables, Data Types, Operators, Basic Input and Output Operations, Expressions and Precedence of Operators, In-built Functions.
Unit II: Decision Making, Branching, and Looping (7 Hrs)
Introduction, Decision Making with If Statement, Simple If Statement, Nesting of If...Else Statements, Else If Ladder, ?: Operator, Goto Statement, While Statement, Do Statement, For Statement, Jumps in Loops, Concise Test Expressions.
Unit III: Arrays (7 Hrs)
Introduction to Arrays, One-Dimensional Arrays, Two-Dimensional Arrays, Multi-Dimensional Arrays, Example Programs Using Arrays.
Unit IV: Strings (8 Hrs)
Declaring and Initializing String Variables, Reading Strings from Terminal, Writing Strings to Screen, Arithmetic Operations on Characters, String-handling Functions, Example Programs (with and without using built-in string functions).
Unit V: Functions & Pointers (8 Hrs)
Introduction to Functions, Need for User-Defined Functions, Multi-Function Program, Elements of User-Defined Functions, Definition of Functions, Return Values and their Types, Function Calls, Function Declaration, Category of Functions, Recursion. Introduction to Pointers, Declaring Pointer Variables, Initialization of Pointer Variables, Accessing a Variable through its Pointer, Pointer Expressions, Pointer Increments, and Scale Factor.
Unit VI: Structures, Unions, and File Management (8 Hrs)
Defining a Structure, Declaring Structure Variables, Accessing Structure Members, Structure Initialization, Arrays of Structures, Unions and Structures. Introduction to Files, Defining and Opening a File, Closing a File, Input/Output and Error Handling on Files.
Text Book
E. Balaguruswamy, "Programming in ANSI C", McGraw-Hill.
Tokens: Smallest individual units in a program (Keywords, Identifiers, Constants). Data Types: Primary (int, float, char), Derived (array, pointers), User-defined (structure, enum). Operators: Symbols that tell the compiler to perform specific mathematical or logical manipulations (Arithmetic, Relational, Logical).
Branching: 'If', 'If-Else', 'Switch' statements allow execution of different code blocks based on conditions. Looping: 'For', 'While', 'Do-While' loops execute a block of code repeatedly until a condition is met.
Definition: A collection of elements of the same data type stored in contiguous memory locations. Types: One-dimensional (list), Two-dimensional (matrix/table). Accessing: Elements are accessed via index, starting from 0.
String: A one-dimensional array of characters terminated by a null character ('\0'). Handling Functions: The <string.h> library provides functions like strlen() (length), strcpy() (copy), strcat() (concatenate), and strcmp() (compare).
Functions: Self-contained blocks of code performing a specific task. Supports modularity. Recursion: A function calling itself. Pointers: Variables that store the memory address of another variable. Operators: * (value at address) and & (address of).
Structure: A user-defined data type grouping related variables of different data types. Unions: Similar to structures but all members share the same memory location. Files: Persistent storage. Operations include fopen, fclose, fprintf, fscanf.