SONA COLLEGE OF TECHNOLOGY
DEPARTMENT OF CSE
U23CPR205-PROGRAMMING IN C
Unit 01: C PROGRAMMING BASICS
Structure of a C program
C Character set,
Identifiers (variable name,function name,structure name,array names,etc)
-A particular name generated by the programmer to define a variable, structure, class, or
function is called an identifier.
-rules for naming identifiers
Keywords,(Reserved words or predefined word)
32 keywords in C- auto,if,etc
Data Types,
Explanation of each datatype,example
Declarations,
How to declare variable? example
Expressions,
What is expression?
Types of expression= definition with example
Statements- each line of program
Symbolic constants-definition
#define pi 3.14
Operators – Types-unary,binary,ternary based on number of operand
Types - Arithmetic Operators - Unary operators - Relational and Logical Operators -
Assignment operators - Conditional operators. For all operator explanation with example
Unformatted (getc,gets,putc,puts,getch,putch,getchar,putchar)
Syntax,explanation,example
formatted Input/Output functions(printf,scanf,sscanf,sprint,fscanf,fprintf)
Syntax,explanation,example
pre- processor directives
Macros,
file inclusion,
conditional compilation
miscellaneous directives
Syntax,explanation,example for above
storage classes.-auto,static,extern,register
Syntax,explanation,example for above
Unit 02: CONTROL STATEMENTS, ARRAYS AND STRING
branching
Conditional statements,
Unconditional statements
Conditional statements,
-if,if else,nested if else,else if ladder,switch case
Syntax,,Flowchart,explanation,example program for above
Unconditional statements,
Break,continue,goto
Syntax,,Flowchart,explanation,example program for above
looping statements
While,do while,for loop
Syntax,,Flowchart,explanation,example program for above
Sentinel and counter controlled loop
Entry and exit control loop
Arrays
Definition,Syntax,example program
Declaration
Syntax, example,memory representation
Array- Initialization
Compile time initialization
Run time Intialization
One dimensional and Two dimensional arrays.
Definition, Syntax, example program
Application of one dimensional array --Simple programs- sorting -searching
Definition, Syntax, example program
Application of two dimensional array- matrix operations.(ALL)
Definition, Syntax, example program
String-
Definition
Difference and character array and string
Null character
Example program
String operations -few functions listed below refer in book also
For each function, syntax, Definition
example program
String Arrays. (Array of string)
Definition
Unit 03: FUNCTIONS AND POINTERS
Function
What is function?
What is the need for function?
Advantages for using function
Syntax of function -3 parts(Declaration,Definition,call)
Explain and give example program
Function return type
Library functions (built in or predefined functions)
Definition, example
user-defined functions (Tailor made function)
Definition, example
Function prototypes and function definitions
Function prototypes
Call by value
Definition, Explanation,example program
Call by reference
Definition, Explanation,example program
Recursion
Definition, Explanation, example program
Why there is need for recursion function?
Factorial, Fibonacci,etc
Pointers
Definition
Initialization
Pointers arithmetic
Increment/decrement of pointer
Addition of integer to a pointer
Subtraction of integer to a pointer
Subtracting two pointers
Comparison of pointers
Explanation, syntax, Example program
Pointers and arrays Explanation, syntax, Example program
Pointers and Functions Explanation, syntax, Example program
Dynamic memory Allocation -malloc,calloc,dealloc,realloc,free Explanation, syntax,
Example program
Unit 04: STRUCTURES AND UNIONS
Need for structure data type
Explanation
structure definition –
Structure declaration –
Ways of declaring structure
How memory allocation will be done?
Syntax, member, etc
Explanation
Example program
Structure within a structure –Nested Structure
2 ways -separate and embedded structure
Explanation
Example program
Passing structures to functions
Explanation
Example program
Array of structures
Explanation
Example program
Pointers to structures
Explanation
Example program
Union
Syntax, member, etc
Explanation
Example program
How union is different from structure?
How size of union is calculated?
How size of structure is calculated?
Unit 05: FILE MANIPULATIONS
Files
Definition,
Types of file
Difference between text and binary file
File operations-for both text and binary files
Types of File processing-
Sequential access -Random Access File
Explanation
Example program
Command line arguments.
Explanation
Example program
Note:
Refer PPT’s, Text book , Class notes unit wise uploaded in whatsapp group as well as in
blackboard (moodle).