CMP 103.
3 Programming in C (3-0-3)
Evaluation:
Theory Practical Total
Sessional 30 20 50
Final 50 - 50
Total 80 20 100
Course Objectives:
The object of this course is to acquaint the students with the basic principles of programming and development of
software systems. It encompasses the use of programming systems to achieve specified goals, identification of
useful programming abstractions or paradigms, the development of formal models of programs, the formalization of
programming language semantics, the specification of program, the verification of programs, etc. the thrust is to
identify and clarify concepts that apply in many programming contexts:
Chapter Content Hrs.
1 Introduction 3
History of computing and computers, programming, block diagram of computer, generation
of computer, types of computer, software, Programming Languages, Traditional and
structured programming concept
2 Programming logic 5
Problems solving(understanding of problems, feasibility and requirement analysis) Design
(flow Chart & Algorithm), program coding (execution, translator), testing and debugging,
Implementation, evaluation and Maintenance of programs, documentation
3 Variables and data types 3
Constants and variables, Variable declaration, Variable Types, Simple input/output
function, Operators
4 Control Structures 6
Introduction, types of control statements- sequential, branching- if, else, else-if and switch
statements, case, break and continue statements; looping- for loop, while loop, do—while
loop, nested loop, goto statement
5 Arrays and Strings 6
Introduction to arrays, initialization of arrays, multidimensional arrays, String, function
related to the strings
6 Functions 6
Introduction, returning a value from a function, sending a value to a function, Arguments,
parsing arrays and structure, External variables, storage classes, pre-processor directives,
C libraries, macros, header files and prototyping
Pokhara University/Faculty of Science & Technology/Revised Syllabus-2012/Programming in C 1
7 Pointers 7
Definition pointers for arrays, returning multiple values form functions using pointers.
Pointer arithmetic, pointer for strings, double indirection, pointer to arrays, Memory
allocation-malloc and calloc
8 Structure and Unions 5
Definition of Structure, Nested type Structure, Arrays of Structure, Structure and Pointers,
Unions, self-referential structure
9 Files and File Handling 4
Operating a file in different modes (Real, Write, Append), Creating a file in different modes
(Read, Write, Append)
Laboratory:
Laboratory work at an initial stage will emphasize on the verification of programming concepts learned
in class and use of loops, functions, pointers, structures and unions. Final project of 10 hours will be
assigned to the students which will help students to put together most of the programming concepts
developed in earlier exercises.
Textbooks:
1. Programming with C, Byran Gottfried
2. C Programming, Balagurusami
References
1. A book on C by A L Kely and Ira Pohl
2. The C Programming Language by Kerighan, Brain and Dennis Ritchie
3. Depth in C, Shreevastav
Pokhara University/Faculty of Science & Technology/Revised Syllabus-2012/Programming in C 2