COURSE TITLE Problem Solving using C
COURSE CODE BTCS1101 TOTAL CREDITS: L T P S R O C
/F
TOTAL HOURS: 3 0 2 0 0 0 4
PRE-REQUISITE CO-REQUISITE
ANTI-REQUISITE NIL
PROGRAMMES B. Tech. in Computer Science & Engineering
SEMESTER 1st
COURSE OBJECTIVES (2-3):
1. To formulate simple algorithms for arithmetic and logical problems.
2. To test and execute the programs and correct syntax and logical errors.
COURSE OUTCOMES (3-5):
CO1 Understand computer system elements and a foundational comprehension of algorithms and
programming.
CO2 Utilize branching and looping statements to address decision-making programming problems.
CO3 Apply homogeneous derived data types, heterogeneous data types, strings, and functions
effectively for programming tasks.
CO4 Demonstrate understanding of pointers and applying their concepts skillfully in programming
scenarios.
CO5 Apply file handling concepts in C programming with competence, ensuring effective data
management and storage solutions.
COURSE DESCRIPTION:
This course is to teach students the basic of pure programming and problem solving. This course
provides students with a comprehensive study of the C programming language. The course
emphasizes problem- solving and empirical skills through the process of designing, implementing,
and executing C programs.
TEXT BOOKS:
T1. E. Balaguruswamy, Programming in ANSI C, TataMcGraw-Hill.
T2. Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language, PrenticeHall
of India.
REFERENCE BOOKS:
R1. Byron Gottfried, Schaum's Outline of Programming with C, McGraw-Hill
OTHER LEARNING RESOURCES
UNIT- CONTENT CONTACT LEARNING KNOWLEDGE REFERENCE/
NO HRS OUTCOME LEVELS LEARNING
MATERIALS
I Introduction to Programming 8 C1 Remembering,
Introduction to components of a
computer system (disks, memory, Understanding,
processor, where a program is stored Applying
and executed, operating system,
compilers etc.) Idea of Algorithm: steps
to solve logical and numerical
problems. Representation of
Algorithm: Flowchart/Pseudocode with
examples. From algorithms to
programs; source code, variables (with
data types) variables and memory
locations, Syntax and Logical Errors in
compilation, Object and executable
code
II Arithmetic expressions and precedence 12 C2 Applying,
Conditional Branching and Loops: Analyzing
Writing and evaluation of conditionals
and consequent branching, Iteration
and loops Arrays: Arrays (1-D, 2-D),
Character arrays and Strings Basic
Algorithms: Searching, Basic Sorting
Algorithms (Bubble, Insertion and
Selection), Finding roots of equations,
forming Pyramid structure
III Function: Functions (including using 8 C3 Applying,
built in libraries), Parameter passing in Analyzing
functions, call by value, passing arrays
to functions: idea of call by reference
Recursion: Recursion, as a different
way of solving problems. Example
programs, such as Finding Factorial,
Fibonacci series, Ackerman function
etc. Quick sort or Mergesort.
IV Structure: Structures, Defining 6 C4 Analyzing
structures and Array of Structures
Pointers: Idea of pointers, Defining
pointers, Use of Pointers in self-
referential structures, notion of linked
list (no implementation)
V Introduction, Defining and opening a 5 C5 Analyzing
file, closing a file, Input/output and
Error Handling on Files.
Lab Syllabus:
Week Name of the Program Page No
a) Write a C program to find sum and average of three numbers. 1-6
b) Write a C program to find the sum of individual digits of a given positive
1 c) Write a C program to generate the first n terms of the Fibonacci sequence
a) Write a C program to generate prime numbers between 1 to n. 7-12
b) Write a C program to Check whether given number is Armstrong Number or Not.
2
a) Write a C program to evaluate algebraic expression (ax)/ (ax-b). 13-15
b) Write a C program to check whether given number is perfect number or Not
3 c) Write a C program to check whether given number is strong number or not.
a) Write a C program to find the roots of a quadratic equation. 16-21
4 b) Write a C program perform arithmetic operations using switch statement.
a) Write a C program to find factorial of a given integer using non-recursive
Function.
5 22-25
b) Write a C program to find factorial of a given integer using recursive function.
6 a) Write C program to find GCD of two integers by using recursive function. 26-29
b) Write C program to find GCD of two integers using non-recursive function.
a) Write a C program to find both the largest and smallest number in a list of
Integers
7 30-34
b) Write a C Program to Sort the Array in an Ascending Order.
c) Write a C Program to find whether given matrix is symmetric or not.
a) Write a C program to perform addition of two matrices. 35-40
b) Write a C program that uses functions to perform Multiplication of Two Matrices.
8
a) Write a C program to use function to insert a sub-string in to given main string from a 41-45
given position.
9 b) Write a C program that uses functions to delete n Characters from a give position in a
given string.
a) Write a C program using user defined functions to determine whether the given string 46-49
is palindrome or not.
10 b) Write a C program that displays the position or index in the main string S where the
sub string T begins, or - 1 if S doesn't contain T
a) Write C program to count the number of lines, words and characters in a given text. 50-53
11 b) Write a C program to find the length of the string using Pointer.
a) Write a C program to Display array elements using calloc( ) function 54-55
b) Write a C Program to Calculate Total and Percentage marks of a student using
12 structure.
a) Write a C program that uses functions and structures to perform the following
operations:
i) Reading a complex number
ii) Writing a complex number
iii) Addition of two complex numbers
13 iv) Multiplication of two complex numbers 56-60
b) Write a C program to display the contents of a file
a) Write a C program to copy the contents of one file to another.
b) Write a C program to merge two files into a third file.
14 c) Write a C program to reverse the first n characters in a file 61-67