CProgramming_syllabus&LabPlan
CProgramming_syllabus&LabPlan
CSEG1025 Programming in C 3 0 0 3
Total Units to be Covered: 7 Total Contact Hours: 45
Prerequisite(s): Elementary knowledge of Computer Syllabus version: 1.0
Course Objectives
1. Introduce students to the basic principles and concepts of programming.
2. Develop students' ability to solve programming problems by applying the
fundamental concepts of C programming.
3. Demonstrate students how to design and develop structured programs using
modular programming techniques.
4. Enable students to apply their C programming skills to develop small-scale
applications.
Course Outcomes
CO-PO Mapping
Program
Outcomes
Course PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3
Outcomes
CO 1 - - - - 3 - - - 1 - - - - - -
CO 2 - - - - 2 - - - - - - - - -
CO 3 - - - - 1 - - - - - - - - -
CO4 - - - - 2 - - - - - - - - -
CO5 - - 2 - 2 - - - 2 - - 2 - - -
CONFIDENTIAL | 28
Average - - .4 - 2 - - - .6 - - .4 - - -
Syllabus
Data types and type conversion, variables (declaration vs definition, local vs global),
keywords, header files, structure of a C program. Operators: types of operators
(arithmetic, relational, logical, bit-wise, increment/decrement, assignment, sizeof,
ternary), operator precedence and associativity. Conditional statements: if, else,
switch-case, break, continue, goto, label. Loops: for, while and do-while.
Array, Multi-dimensional arrays, Strings, Function, Pass and Return by value, Pass
and Return by Reference, Recursion, Scope Rules.
Structure, typedef, Union, Enum, Bit-Fields, Pointer, Pointer to Arrays, Pointer Arrays,
Pointer to Pointers, Address Arithmetic, Pointer to Structures, Pointer to functions,
Bit-wise operator.
Unit VI: Preprocessor, Macro, Static and Shared Library 8 Lecture Hours
CONFIDENTIAL | 29
Preprocessor & Directives, Macro, Macro vs Functions, C standard library: stdio.h,
ctype.h, stdlib.h, assert.h, stdarg.h, time.h etc., Compilation of a C Program, Static
Library, Shared Library.
Reference Books
1. B. S. S. Gottfried, "Schaum's Outline of Programming with C", 2nd Edition,
McGraw-Hill, 1996.
CONFIDENTIAL | 30
Course Code Course name L T P C
CSEG1125 Programming in C Lab 0 0 4 2
Total Units to be Covered: 18 Total Contact Hours: 60
Prerequisite(s): Elementary knowledge of Computer Systems Syllabus version: 1.0
Course Objectives
1. Familiarize students with the basic principles and concepts of programming
through hands-on practice.
2. Enhance students' problem-solving skills by applying fundamental concepts of C
programming to solve various programming challenges.
3. Enable students to learn and apply modular programming techniques to design
and develop structured programs effectively.
4. Enable students to apply their C programming skills to develop small-scale
applications that demonstrate practical usage of programming concepts.
Course Outcomes
CO-PO Mapping
Program
Outcomes
Course PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3
Outcomes
CO 1 - - - - 3 - - - 1 - - - 1 2 -
CO 2 - - - - 2 - - - - - - - 1 2 -
CO 3 - - - - 1 - - - - - - - 1 2 -
CONFIDENTIAL | 31
CO 4 - - - - 2 - - - - - - - 1 2 -
CO 5 - - 2 - 2 - - - 2 - - 2 1 2 -
Average - - .4 - 2 - - - .6 - - .4 1 2 -
List of Experiments
Experiment 1: Installation, Environment Setup and starting with C language
Experiment 2: Operators
1. WAP to take check if the triangle is valid or not. If the validity is established,
do check if the triangle is isosceles, equilateral, right angle, or scalene. Take
sides of the triangle as input from a user.
2. WAP to compute the BMI Index of the person and print the BMI values as per
the following ranges. You can use the following formula to compute BMI=
weight(kgs)/Height(Mts)*Height(Mts).
BMI
Starvation <15
Overweight 25 to 25.9
Obese 30 to 39.9
3. WAP to check if three points (x1,y1), (x2,y2) and (x3,y3) are collinear or not.
4. According to the gregorian calendar, it was Monday on the date 01/01/01. If
Any year is input through the keyboard write a program to find out what is the
day on 1st January of this year.
5. WAP using ternary operator, the user should input the length and breadth of a
rectangle, one has to find out which rectangle has the highest perimeter. The
minimum number of rectangles should be three.
1. WAP to enter numbers till the user wants. At the end, it should display the
count of positive, negative, and Zeroes entered.
2. WAP to print the multiplication table of the number entered by the user. It
should be in the correct formatting. Num * 1 = Num
3. WAP to generate the following set of output.
a.
23
456
b.
11
CONFIDENTIAL | 33
121
1331
14641
1. Declare a global variable outside all functions and use it inside various
functions to understand its accessibility.
2. Declare a local variable inside a function and try to access it outside the
function. Compare this with accessing the global variable from within the
function.
3. Declare variables within different code blocks (enclosed by curly braces) and
test their accessibility within and outside those blocks.
4. Declare a static local variable inside a function. Observe how its value
persists across function calls.
Experiment 5: Array
1. WAP to read a list of integers and store it in a single dimensional array. Write
a C program to print the second largest integer in a list of integers.
2. WAP to read a list of integers and store it in a single dimensional array. Write
a C program to count and display positive, negative, odd, and even numbers
in an array.
CONFIDENTIAL | 34
3. WAP to read a list of integers and store it in a single dimensional array. Write
a C program to find the frequency of a particular number in a list of integers.
4. WAP that reads two matrices A (m x n) and B (p x q) and computes the
product A and B. Read matrix A and matrix B in row major order respectively.
Print both the input matrices and resultant matrix with suitable headings and
output should be in matrix format only. Program must check the compatibility
of orders of the matrices for multiplication. Report appropriate message in
case of incompatibility.
Experiment 6: Functions
CONFIDENTIAL | 35
Note: represent complex number using a structure.
2. Write a C program to compute the monthly pay of 100 employees using each
employee‗s name, basic pay. The DA is computed as 52% of the basic pay.
Gross-salary (basic pay + DA). Print the employees name and gross salary.
3. Create a Book structure containing book_id, title, author name and price.
Write a C program to pass a structure as a function argument and print the
book details.
4. Create a union containing 6 strings: name, home_address, hostel_address,
city, state and zip. Write a C program to display your present address.
Experiment 8: Pointers
1. Declare different types of pointers (int, float, char) and initialize them with the
addresses of variables. Print the values of both the pointers and the variables
they point to.
2. Perform pointer arithmetic (increment and decrement) on pointers of different
data types. Observe how the memory addresses change and the effects on
data access.
3. Write a function that accepts pointers as parameters. Pass variables by
reference using pointers and modify their values within the function.
1. Write a program to create a new file and write text into it.
2. Open an existing file and read its content character by character, and then
close the file.
3. Open a file, read its content line by line, and display each line on the console.
1. Write a program to create a simple linked list in C using pointer and structure.
2. Write a program to insert item in middle of the linked list.
CONFIDENTIAL | 36
1. Write a program to apply bitwise OR, AND and NOT operators on bit level.
2. Write a program to apply left shift and right shift operator.
Textbooks
CONFIDENTIAL | 37
1. B. W. Kernighan, and D. M. Ritchie, "The C programming language", 2nd Edition,
Prentice Hall, 1988.
Reference Books
1. B. S. S. Gottfried, "Schaum's Outline of Programming with C", 2nd Edition,
McGraw-Hill, 1996.
CONFIDENTIAL | 38