1.syllabus Book Updated
1.syllabus Book Updated
Semester: I
Programming in C
Category : MAJOR COMPUTER SCIENCE CORE
(Theory and Lab)
Course Code : CS1003 CIE : 70 Marks
Credits 4
: SEE : 30 Marks
L:T:P Hours 3:0:2
Total Hours : 45L+30P SEE Duration : 2:00 Hours
Course Overview
This course provides a thorough introduction to the ‘C’ programming language. The first two weeks
will cover basic syntax and grammar, and expose students to practical programming techniques. The
remaining lectures will focus on more advanced concepts, such as arrays, functions including
recursion, pointers, dynamic memory allocation, structures, union, and file handling.
Unit-I 03 Hrs
Computer Fundamentals and C Language:
Fundamentals of Computers: C Language: Structure of C Program, Memory Layout of C
Programs, Phases of developing a running computer program in C, how does a C Program
Execute - Pre processor, Compiler, Linker, Loader, Library Functions, Various components of
a computer that programs require for execution.
Unit – II 06 Hrs
Data Concepts and Operators:
Data concepts in C: Constants, Variables - Variables as named memory locations, Rules for
Constructing Variables, understanding different Data Types - range, size, and appropriate
usage, C Keywords, format specifiers - %d, %c, %ud, %l, %f, Uses and Common Errors
associated with them, Instruction, Pre- processor Directive, Macros.
Operator in C: Arithmetic Operators - Hierarchy of operations, Precedence, Relational
Operators - (>, <, >=, <=, !=, ==), Logical Operators - Logical AND (&&), Logical OR ( || )
Logical Not (!), Conditional Operators - (?:), Bit-wise Operators - ( &, |, ^, ~, <<, >> ),
Assignment Operators. Type Conversion and Type Casting.
Unit –III 15 Hrs
Decision Control, Loops, and Functions:
Decision Control in C: if Statement, else-if Statement, nested else -if Statement - Use case,
example for nested if-else, switch. Loop statements: for, while, do-while, break (from loop),
continue, exit - exit status to represent the exit code of the program, program clean ups done
by exit function.
Introduction to Functions-: Function Declaration and Definition. Function Prototype.
Calling a Function, Return Value. Parameters and Arguments. Local, Global, and Static
Variables. Pass by value and reference.
Understanding the use of pointers. Recursion: Basic concept of recursion, Study of basic
problems using recursion: factorial, GCD, Fibonacci series.
Unit –V 11 Hrs
Structures and Files:
Structures: Introduction to Structures and Unions, Structure Definition and Declaration,
Accessing Structure Members. Array of Structures. Passing Structures to Functions. Pointer to
Structures. Accessing Structure Members through Pointers. Passing Structures as Reference.
Basic file operations: Creating a new file, opening an existing file, reading from file, writing
to a file, moving to a specific location in a file, Closing a file.
Course Outcomes: After completing the course, the students will be able to: -
CO 1 Understand and analyze the concepts of number system, memory, fundamental
concepts in C programming language.
CO 2 Demonstrate fundamental data types, operators and console I/O functions in C.
CO 3 Implement programs using decision control statements, control flow statements,
arrays, strings, functions, and pointers to solve mathematical problems.
CO 4 Analyze and evaluate the programming concepts based on user defined data types
and file handling in C language.
CO 5 Design and implement appropriate concepts of C to solve real-world problems.
Textbook Books
The C Programming Language by Brian W. Kernighan and Dennis Ritchie. Pearson
1
Education India; 2nd edition (1 January 2015). ISBN-10: 9332549443. ISBN-13:
978-9332549449
Computer Programming in C by Rajaraman V. Prentice Hall India Learning Private
2
Limited (1 January 1994). ISBN-10: 9788120308596. ISBN-13: 978-8120308596
C Programming Absolute Beginne (Absolute Beginner's Guide) by Greg Perry and Dean
3
Miller. Que Publishing; 3rd edition (22 August 2013). ISBN-10: 0789751984. ISBN-13:
978-0789751980.
Let Us C: Authentic guide to C programming language by Yashavant Kanetkar. BPB
4
Publications; Nineteenth edition (15 December 2022); BPB Publications, Ansari Road,
Dariya Ganj. ISBN-10: 9355512767. ISBN-13: 978-9355512765.
Reference Books
1 How To Solve It By Computer by R G Dromey. ISBN-10: 8120303881. ISBN-13:
. 978-8120303881
2 Problem Solving and Programming Concepts by Sprankle, Pearson Education India; 9th
. edition (1 January 2013). ISBN-10: 9789332518841. ISBN-13: 978-9332518841
LABORATORY COMPONENT
1. a. Write a program using function-like macros to add two numbers.
a. Write a program to find the area of a circle using macros.
a. Write a program to swap two numbers with and without using a third variable.
a. Write a program to compute and display area/perimeter and surface area/volume of
different 2D/3D shapes respectively
a. Write a program to print a grocery bill.
a. Write a program to find the roots of the quadratic equation ax^2+bx+c=0.
a. Write a program to create a menu-driven basic arithmetic calculator.
a. Write a program to print an electricity bill.
a. Write a program to print the marksheet of a student.
a. Write a program to print the number of digits in an integer and their sum.
a. Write a program to print different patterns on the screen.
a. Write a program to print a Fibonacci series.
a. Write a program to compute GCD of two numbers.
a. Write a program to find Armstrong numbers in the given range of numbers.
a. Write a program to obtain prime factors of a given number using function.
a. Write a program to find factorial of a number using function.
a. Write a program to print nth term of a Fibonacci series using function.
a. Write a program to compute GCD of two numbers using function.
a. Write a program to swap two numbers using function.
a. Write a program to find factorial of a number using recursion.
a. Write a program to print a Fibonacci series using recursion.
a. Write a program to compute GCD of two numbers using recursion.
a. Write a program to print the number of digits in a number and their sum using
recursion.
a. Write a menu driven program to demonstrate the following array operations using
functions: Insert, Delete, Update element at index i, Swap elements at two indices,
Linear search, Search all the occurrences, Search the first occurrence, Search the
last occurrence, Find duplicates, Remove duplicates, Find minimum, and Find
maximum.
a. Write a program to implement Bubble and Insertion sort using functions.
a. Write a program to implement binary search using function.
a. Write a program to print matrix multiplication using function.
a. Write a program to traverse a two-dimensional array in spiral order using function.
a. Write a program to implement different string operations using functions.
1 a. Write a program using pointer to structures to read, write and compute
0 average-marks of a student. Take student name, USN, and marks in 5 subjects as
input. Use functions.
a. Write a program using structures to read, write and compute average-marks of n
students. Take student name, USN, and marks in 5 subjects as input. Pass structure
by reference to a function to update marks in one of the five subjects as given by
user for a particular student. Finally display the new average for that student.
1 a. Write a program to demonstrate different file operations in C.
1