Course Category : Major Core
Course Name : Programming in C
Course Code : UCS1003
L-T-P : 3-0-2
Semester :I
Batch : 2024-28
Syllabus
Prerequisite:
The student should understand:
● Simple Mathematics & basic comprehension skills.
Course Outcomes:
At the end of the course, students will be able to:
CO1 Develop Simple Algorithms for Arithmetic and Logical Problems.
CO2 Apply loop, decision making constructs to solve a given problem.
CO3 Implement arrays, structures, and union to formulate algorithms and programs and apply it
for searching and sorting problems.
CO4 Decompose a Problem into Functions and Synthesize a Complete Program Using Divide and
Conquer Approach.
CO5 Apply the concept of pointers to develop algorithms and programs.
Unit Topics CO No. of
No No. Lecture
1 Introduction to Components of a Computer System: Memory, 1 8
Processor, I/O Devices, Storage, Operating System, Concept of
Assembler, Compiler, Interpreter, Loader and Linker.
Idea of Algorithm: Representation of Algorithm, Flowchart, Pseudo
Code with Examples, From Algorithms to Programs, Source Code.
Programming Basics: Structure of C Program, Writing and Executing
the First C Program, Syntax and Logical Errors in Compilation, Object
and Executable Code. Components of C Language. Standard I/O in C ,
Fundamental Data types, Variables and Memory Locations, Storage
Classes.
2 Arithmetic Expressions and Precedence : Operators and 2 8
Expression Using Numeric and Relational Operators, Mixed
Operands, Type Conversion, Logical Operators, Bit Operations,
Assignment Operator, Operator precedence and Associatively.
Conditional Branching: Applying if and Switch Statements,
Nesting if and Else and Switch.
Iteration and Loops: Use of While, do While and for Loops,
Multiple Loop Variables, Use of Break, Goto and Continue
Statements.
3 Arrays: Array Notation and Representation, Manipulating Array 3 8
Elements, using Multi-Dimensional Arrays. Character Arrays and
Strings, Structure, union, Enumerated Data types, Array of
Structures Basic of searching and Sorting Algorithms: Linear
Search , Bubble Sort
4 Functions: Introduction, Types of Functions, Functions with 4 8
Array, Passing Parameters to Functions, Call by Value, Call by
Reference, Passing Arrays to Functions. Recursive Functions.
5 Pointers – Declarations – Passing pointers to functions – 5 8
Operation in Pointers - Pointers Arrays – Arrays of pointers –
Structures and pointers
Text Book:
1. B.W. Kernighan and D.M. Ritchie, The C Progamming Language, 2nd Edition, PHI, 1988.
2. Kanethkar Y., Let us C, BPB Pub., New Delhi. 1999.
Reference Book:
1. Computer Concepts and Programming in C, E Balaguruswami, McGraw Hill
2. Computer Concepts and Programming in C, R.S. Salaria, Khanna Publishing House
List of Programs
Lab Course Outcomes:
At the end of the course, students will be able to:
CO1 Apply the branching and looping constructs to execute the basic C programs.
CO2 Execute the programs based on Array and Structure,
CO3 Execute programs based on functions and pointers.
S. Programs CO
No. No.
1 Write a Program to print different data types in ‘C’ and their ranges. 1
2 Write a C program to find the sum and average of three numbers. 1
3 Write a program to swap the values of two variables with and without using the 1
third variable.
4 Write a Program to read radius value from the keyboard and calculate the area of 1
circle and print the result in both floating and exponential notation.
5 Write a program to find whether the given year is a leap year or not. 1
6 Write a program that checks whether the two numbers entered by the user are equal 1
or not.
7 Write a program to find the greatest of three numbers. 1
8 Write a program that finds whether a given number is even or odd. 1
9 Write a program that tells whether a given year is a leap year or not. 1
10 Write a program that accepts marks of five subjects and finds percentage and prints 1
grades according to the following criteria:
Between 90-100%-----Print ‘A’
80-90%-----------------Print ‘B’
60-80%-----------------Print ‘C’
Below 60%-------------Print ‘D’
11 Write a program that takes two operands and one operator from the user, perform the 1
operation, and prints the result by using Switch statement.
12 Write a program to print the sum of all numbers up to a given number. 1
13 Write a program to find the factorial of a given number. 1
14 Write a program to print sum of even and odd numbers from 1 to N numbers. 1
15 Write a program to print the Fibonacci series. 1
16 Write a program to check whether the entered number is prime or not using function 3
17 Write a program to find the reverse of a number using a function. 1
18 Write a program to print Armstrong numbers from 1 to 100 using a function. 3
19 Write a recursive function to calculate the factorial of a given number. 3
20 Write a program that simply takes elements of the array from the user and finds the 3
sum of these elements using function.
21 Write a program that inputs two arrays and saves the sum of corresponding elements 2
of these arrays in a third array and prints them.
22 Write a program to find the minimum and maximum element of the array. 2
23 Write a program to search an element in an array using Linear Search. 2
24 Write a program to sort the elements of the array in ascending order using Bubble 2
Sort technique.
25 Write a program to add and multiply two matrices of order n x n. 2
26 Write a program that finds the sum of diagonal elements of a m x n matrix. 2
27 Write a program to implement strlen (), strcat (),strcpy () using the concept of 2
Functions.
28 Write a program Define a structure data type TRAIN_INFO. The type contains Train 2
No.: integer type Train name: string Departure Time: aggregate type TIME Arrival
Time: aggregate type TIME Start station: string End station: string The structure type
Time contains two integer members: hour and minute. Maintain a train timetable and
implement the following operations:
a. List all the trains (sorted according to train number) that depart from a particular
section.
b. List all the trains that depart from a particular station at a particular time.
c. List all the trains that depart from a particular station within the next one hour of a
given time.
d. List all the trains between a pair of start station and end station
29 Write a program to swap two elements using the concept of pointers. 3