## OCS752 Syllabus - Introduction To C Programming - 2017 Regulation - Open Elective | Anna University

OCS752

INTRODUCTION TO C PROGRAMMING

L T P C

3003

OBJECTIVE:
• To develop C Programs using basic programming constructs
• To develop C programs using arrays and strings
• To develop applications in C using functions and structures

UNIT I

INTRODUCTION

9

Structure of C program – Basics: Data Types – Constants –Variables - Keywords – Operators: Precedence and Associativity - Expressions - Input/Output statements, Assignment statements – Decision-making statements - Switch statement - Looping statements – Pre-processor directives - Compilation process – Exercise Programs: Check whether the required amount can be withdrawn based on the available amount – Menu-driven program to find the area of different shapes – Find the sum of even numbers
Text Book: Reema Thareja (Chapters 2,3)

UNIT II

ARRAYS

9

Introduction to Arrays – One dimensional arrays: Declaration – Initialization - Accessing elements – Operations: Traversal, Insertion, Deletion, Searching - Two dimensional arrays: Declaration – Initialization - Accessing elements – Operations: Read – Print – Sum – Transpose – Exercise Programs: Print the number of positive and negative values present in the array – Sort the numbers using bubble sort - Find whether the given is matrix is diagonal or not. Text Book: Reema Thareja (Chapters 5)

UNIT III

STRINGS

9

Introduction to Strings - Reading and writing a string - String operations (without using built-in string functions): Length – Compare – Concatenate – Copy – Reverse – Substring – Insertion – Indexing – Deletion – Replacement – Array of strings – Introduction to Pointers – Pointer operators – Pointer arithmetic - Exercise programs: To find the frequency of a character in a string - To find the number of vowels, consonants and white spaces in a given text - Sorting the names. Text Book: Reema Thareja (Chapters 6 & 7)

UNIT IV

FUNCTIONS

9

Introduction to Functions – Types: User-defined and built-in functions - Function prototype - Function definition - Function call - Parameter passing: Pass by value - Pass by reference - Built-in functions (string functions) – Recursive functions – Exercise programs: Calculate the total amount of power consumed by ‘n’ devices (passing an array to a function) – Menu-driven program to count the numbers which are divisible by 3, 5 and by both (passing an array to a function) – Replace the punctuations from a given sentence by the space character (passing an array to a function) Text Book: Reema Thareja (Chapters 4)

UNIT V

STRUCTURES

9

Introduction to structures – Declaration – Initialization – Accessing the members – Nested Structures – Array of Structures – Structures and functions – Passing an entire structure – Exercise programs: Compute the age of a person using structure and functions (passing a structure to a function) – Compute the number of days an employee came late to the office by considering his arrival time for 30 days (Use array of structures and functions) Text Book: Reema Thareja (Chapters 8)

TOTAL: 45 PERIODS

OUTCOMES:Upon completion of this course, the students will be able to
• Develop simple applications using basic constructs
• Develop applications using arrays and strings
• Develop applications using functions and structures

TEXT BOOKS:
1. Reema Thareja, “Programming in C”, Oxford University Press, Second Edition, 2016

REFERENCES:
1. Kernighan, B.W and Ritchie,D.M, “The C Programming language”, Second Edition, Pearson Education, 2006
2. Paul Deitel and Harvey Deitel, “C How to Program”, Seventh edition, Pearson Publication
3. Juneja, B. L and Anita Seth, “Programming in C”, CENGAGE Learning India pvt. Ltd., 2011
4. Pradip Dey, Manas Ghosh, “Fundamentals of Computing and Programming in C”, First Edition, Oxford University Press, 2009