0% found this document useful (0 votes)
40 views

OCS752- Introduction to C Programming

Uploaded by

nagarajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

OCS752- Introduction to C Programming

Uploaded by

nagarajan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 134

V V COLLEGE OF ENGINEERING

VVNagar,Arasoor,Tisaiyanvilai

DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING

OCS752 – Introduction to C Programming

Unit 1 to 5

Handwritten Notes

Prepared by
Mrs.K.Vishnu Priya
AP / CSE
VVCOE
OCS752 Introduction to C Programming L T P C
3 0 0 3
Objectives :
• 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
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


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
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
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)

Outcomes:
• Develop algorithmic solutions to simple computational problems.
• Read, Write, execute by hand simple C programs.
• Structure with simple C Programs for solving problems using statements.
• Represent data using arrays and strings operations.
• Decompose a C program into functions and pointers
• Represent and write program using structure and union.

You might also like