Programming in C DR P Rizwan Ahmed
Programming in C DR P Rizwan Ahmed
C
(ANSI C)
Dr.P.Rizwan Ahmed
Margham Publications
Programming in C
( For B. Sc Computer Science, B.Sc., Software Computer Science, B.Sc. ISM, B.Sc. IT,
B.Sc. Software System, B.Sc. Software Engineering, B.Sc.(Physics with CA),
B.Sc.(Mathematics with CA),B.Sc.(Software System), B.Sc.(Electronics),
B.Sc.(Electronics and Communication Systems), B.Com (CA),B.Com(IT), BCA,
MCA, and IT Professionals.)
Margham
Publications
CONTENTS
Preface
Acknowledgement
Chapter 1
Basic of Programming
1.1 Introduction
1.2 Problem Solving Techniques
1.3 Algorithm
1.3.1 Properties of an Algorithm
1.4 Flow Charts
1.5 Symbols Used in Flowcharts
Summary
Review Questions
Chapter 2
C Language Fundamentals
2.1 Introduction to C
2.2 History of C
2.3 Why use C?
2.4 Why Learn C?
2.5 Advantages / Features of C language
2.6 Structure of C -Program
2.7 Creation and Execution of a C-Program
2.8 Programming Elements
2.8.1 Character Set
2.8.2 Keywords
2.8.3 Identifiers
2.8.4 Constants
2.8.5 Escape Sequence
2.9 Data Types
2.9.1 Fundamental Data Types
2.9.2 Derived data types
2.9.3User-defined data types
2.10Variables
2.10.1 Rules for Defining Variables
2.10.2 Declaration of variable
2.10.3 Initialization of Variables / Assigning values to variables
2.10.4 Difference between Identifier and Variable
2.11 Type Conversion
2.12 Type Casting
3.1 Operators
3.1.1 Arithmetic Operators
3.1.2Relational Operators
3.1.3 Logical Operators
3.1.4 Assignment Operators
3.1.5 Increment and Decrement Operators
3.1.6 Bitwise Operators
3.1.7 Conditional Operator
3.1.8 Special Operators
3.2 Operator Precedence and Associativity
3.3 Sample C Program
3.4 Expressions
3.5 Evaluation of Expressions
3.5.1 Precedence of Arithmetic Operators
3.6 Library Functions
3.6.1 String Handling Functions
3.6.2 Mathematical Functions
Summary
Review Question
Programming Exercise
Chapter 4
Chapter 5
5.1 Functions
5.2 Advantages of functions
5.3 Need for user defined functions
5.4 The form of C Functions
5.5 Return Statement / Return Values and their types
5.6 Function prototype
5.7 Calling a function
5.8Formal and Actual arguments
5.8.1 Formal arguments
5.8.2 Passing arguments
5.9 Category of functions / Types of functions
5.9.1 Function with no arguments and no return value
5.9.2 Function with arguments and no return value
5.9.3 Function with no arguments and return value
5.9.4 Function with arguments and return value
5.10Call by Value and Reference
5.10.1 Call by Value
5.10.2 Call by Reference
5.11 Recursion
Functions
Summary
Review Questions
Programming Exercise
Chapter 6
Storage Classes
Chapter 7
Arrays
7.1 Arrays
7.1.1 Advantages and Disadvantages of Arrays
7.2 Characteristics of arrays
7.3 Types of Arrays
7.3.1 One dimensional array
7.3.2 Two dimensional arrays
7.3.3 Multidimensional arrays
7.4 Strings
7.5 Sample C Programs
Summary
Review Questions
Programming Exercise
Chapter 8
Pointers
9.1 Introduction
9.2 Definition
9.3 Advantages of Using Pointers
9.4 Application of Pointers
9.5 Accessing the address of the variable
9.6 Declaring and Initializing Pointers
9.7 Accessing a Variable through its Pointer
9.8 Pointer Operators
9.9 Operations on Pointers
9.9.1 Pointer Arithmetic and Pointer Expression
9.10 Arrays of Pointers
9.11 Pointers to functions
9.12 Pointers and Arrays
9.13 Pointers and Structures
9.14 Dynamic Memory Allocation
9.15 Command line input or arguments
Summary
Review Questions
Chapter 10
10.1 File
10.2 Creating a file
10.3 Reading a file
10.4 Writing a file
10.5 Opening a file
10.6 Closing a file
10.7 Operations on files
10.8 Sample C Program
Summary
Review Questions
Files in C
Chapter 11
Preprocessor
11.1 Preprocessor
11.1 Including header files
11.2 Conditional Compilation
11.3 Macros
Summary
Review Questions
Chapter 12
APPENDICES
APPENDIX-A: Solved Problems
APPENDIX-B: Questions and Answers
APPENDIX-C: Practical Exercises for Thiruvalluvar University and Periyar University
APPENDIX-D: Past University Question Papers
APPENDIX-E: Solutions for Past University Question Papers