0% found this document useful (0 votes)
12 views5 pages

Problem Solving Using C Syllabus 25-26

The document outlines a course titled 'Problem Solving Using C', which introduces students to the fundamentals of C programming, covering topics such as algorithms, control structures, functions, arrays, strings, pointers, and file handling. It includes practical activities and case studies aimed at developing problem-solving skills and programming proficiency. The course consists of five modules, each with specific learning objectives and practice programs to reinforce the concepts learned.

Uploaded by

thirisha naidu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views5 pages

Problem Solving Using C Syllabus 25-26

The document outlines a course titled 'Problem Solving Using C', which introduces students to the fundamentals of C programming, covering topics such as algorithms, control structures, functions, arrays, strings, pointers, and file handling. It includes practical activities and case studies aimed at developing problem-solving skills and programming proficiency. The course consists of five modules, each with specific learning objectives and practice programs to reinforce the concepts learned.

Uploaded by

thirisha naidu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Course Title Problem Solving Using

Semester 1
C
Course Code 25PL104 Course Type PLC (PSC)
Total No. of Contact Hours 25hr Th + 20hr Pr=45hr CIA Marks 50
No. of Contact Hours/week SEE Marks
2:0:2 50
( L:T:P )
Credits 3 Total Marks 100
Exam. Duration 3hrs
Teaching Department CSE Cluster (Theory)+3hrs(Practi
cal)

Course Overview: The Principles of C Programming course introduces students to the fundamentals of C
language, helping them build strong problem-solving and programming skills. It covers key topics like
algorithms, control structures, functions, arrays, strings, pointers, file handling, and structures. Through hands-
on activities and case studies, students learn to design modular and efficient programs. The course also includes
practical exposure to develop simple C programs using proper logic and structure. By the end of the course,
learners will be equipped to write effective C programs and handle real-world programming tasks.
Course objectives: The student will be able to:
1. Compile and apply the fundamental concepts of C programming to develop simple algorithms for
computational problems.
2. Design structured and modular programs using control structures, functions, and recursion
techniques.
3. Utilize arrays, strings, structures,unions and pointers effectively to solve problems involving data
organization and manipulation.
4. Demonstrate the ability to handle file operations and effectively use preprocessor directives to
support real-world C programming applications.
PREREQUISITES: This course requires that the students are to be familiar with basic computer fundamentals
and basic mathematical concepts such as arithmetic operations and logical operations.

Module-1 Introduction to C Programming Language RBT Level – 1, 2 5 Hours


Algorithmic Problem Solving: Algorithms, building blocks of algorithms (statements, state, control flow,
functions), Notation (Pseudo code, flow chart).
Introduction to the C Language: Basic structure of a C program, Your First C Program, Token:
Identifiers, Variables, Types, Constants, Input / Output.
Expressions: Operators, Precedence and Associativity, Type Conversion.
Textbook 1: Chapter 2.2 – 2.7, 3.1-3.2, 3.4-3.5. Reference Book 1: Chapter 8.4,9.15
Module-2 Functions, Selection – Making Decisions, Repetition RBT Level – 1, 2, 3 5 Hours
Functions: Need for Functions, Elements of Function, Inter-function communication / categories of
functions, Parameter Passing Techniques, scope of variables, Recursion – Factorial, Fibonacci Sequence.
Selection – Making Decisions: Decision making with ‘if’ statement, Simple ‘if’ statement, the ‘if…else’
statement, nesting of ‘if…else’ statements, The ‘else if’ ladder, The ‘switch’ statement, The ‘?:’ operator,
The ‘goto’ statement.

6
Repetition: The ‘for’, ’while’, ’do-while’ statements with examples, Jumps in loops.
Other Examples: Palindrome, Armstrong number, neon number, gcd & lcm.

Activity: Building a Simple ATM Interface Using Functions, Loops, and Conditional Statements
The program should allow users to log in using a 4-digit PIN with a maximum of three attempts. Once
logged in, present a menu using a switch statement to perform operations like checking balance, depositing,
withdrawing, or exiting. Each operation should be handled using separate functions, and the program
should use loops to allow repeated transactions until the user chooses to exit.

Textbook 1: Chapter 4.1 –4.6, 5.1-5.3, 6.1 – 6.9.


Reference Book 1: Chapter 11.8-11.9.
Module-3 Arrays and Strings RBT Level – 1, 2, 3 5 Hours
Arrays: Introduction to Arrays, Declaration and initialization of 1D and 2D arrays.
Searching and Sorting techniques – Linear Search, Binary Search and Bubble Sort.
Strings: Declaration and Initialization of Strings, String Handling Functions.
Activity: A school maintains student exam scores using a simple system where marks are entered in the
order they are received. The staff wants to quickly search for a specific student’s score to analyze
performance. Linear search is too slow for large data, so the school decides to implement a faster solution
using binary search. However, this requires the scores to be sorted first.
Textbook 1: Chapter 8.1 –8.3,8.5- 8.7, 11.1- 11.5
Module-4 Files and Pointers RBT Level – 1, 2, 3 5 Hours

Files: Introduction to files, using files in C, reading and writing data files.
Pointers: Idea of pointers, defining pointers, pointers for inter function communication, pointers to pointers,
Pointer Arithmetic.
Case study: Imagine a scenario that records temperatures for 10 consecutive days, calculates the maximum,
minimum, and average temperatures, and monitors temperatures that exceed a certain threshold. Use dynamic
memory allocation, call by value, call by reference, and return multiple values using pointers.
Textbook 1: Chapter 7.1 – 7.5 , 9.1-9.3,10.2, 10.4
Module-5:Structures, Union and Preprocessor Directives RBT Level – 1, 2, 3 5 Hours
Structures: Introduction, Structure definition, declaring structure variables, accessing structure members,
Structure initialization, Copying and comparing structure variables, Arrays of structure, Arrays within
structures, Structure within structures, Structures and functions.
Union : Unions, unions inside structures.
Preprocessor Directives – Preprocessor directives and its types.

Textbook 1: Chapter 12.1-12.4, Appendix G.1-G.4


Practice Programs:

Pgm. List of Experiments / Programs COs


No.
1 Program 1:
Title: Design and Develop a C program to solve simple computational problems using
arithmetic expressions and use of each operator leading to simulation of a commercial 2
calculator.
Problem Description: The program should prompt the user to input an arithmetic

7
expression, the calculator should support the following operators: Addition (+), subtraction
(-), Multiplication (*), Division(/) and modulus (%) and also should handle the error such
as division by zero , unrecognized operator.
Method: Use a switch statement to perform the chosen arithmetic operation and handle
errors like division by zero or invalid operators using conditional checks and the default
case.
Theory Reference: Module 2, T1:Pg.No - 255
2 Program 2:
Title: Design and Develop a C program to compute the roots of a quadratic equation by
accepting the coefficients. Print appropriate messages.
Problem Description: The program should prompt the user to input the coefficients 'a', 'b',
and 'c' of the quadratic equation. Then, apply the formula to calculate the roots. 2
Method: Use an else-if ladder to evaluate the discriminant and determine the nature of roots
(real and distinct, real and equal, or complex), then compute and display the roots
accordingly.
Theory Reference: Module 2, T1:Pg.No - 261
3 Program 3:
Title: Design and Develop a C program for an electricity board to calculate charges based
on electricity usage. The program should prompt the user to input their name and the number
of units consumed.
Problem Description: Using a tiered pricing structure, calculate the charges as follows:
 For the first 200 units, charge 80 paise per unit
 For the next 100 units (201 to 300), charge 90 paise per unit.
 Beyond 300 units, charge Rs 1 per unit. 2
Additionally, apply a minimum meter charge of Rs. 100 to all users. If the total amount
exceeds Rs 400, include a 15% surcharge. Display the user's name and the total charges
incurred, accounting for the surcharge if applicable.
Method: Use an else-if ladder to apply the tiered pricing based on the number of units
consumed, add a minimum meter charge, check if the total exceeds Rs. 400 to apply a 15%
surcharge, and display the final bill with the user's name.
Theory Reference: Module 2, T1:Pg.No - 263
4 Program 4:
Title: Design and Develop a C Program using functions to compute Sin(x) using Taylor
series approximation. Compare your result with the built- in Library function. Print both the
results with appropriate messages.
Problem Description: The program should prompt the user to input the angle x, then
2
calculate its sine value using the Taylor series expansion.
Method: Use a user-defined function with a do-while loop to calculate sin(x) using the
Taylor series, and compare it with the built-in sin() function.
Theory Reference: Module 2, T1:Pg.No - 319

5 Program 5:
Title: Design and Develop a C program to arrange the elements in descending order using
bubble sort.
Problem Description: The program should prompt the user to input elements into a one-
dimensional array and sort in descending order 3
Method: Use the bubble sort technique by repeatedly comparing and swapping adjacent
elements in the array if they are in the wrong order, until the entire array is sorted in
descending order.
Theory Reference: Module 3, T1:Pg.No – 493

8
6 Program 6:
Title: Design and Develop a C program to perform binary Search using user defined
functions.
Problem Description: The program should prompt the user to input elements into a one-
3
dimensional array and a target value to search for within the array.
Method: Use 1D array to store the integer elements. Also, use user defined functions to
implement the logic of binary search by passing reference.
Theory Reference: Module 3, T1:Pg.No – 505
7 Program 7:
Title: Design and develop a c program using functions to implement string operations such
as compare, concatenate, string, length. Do not use string handling functions.
Problem Description: The program should prompt the user to input two strings and perform
3
the specified operations accordingly.
Method: Use user-defined functions with parameter passing to manually perform string
operations using loops, without built-in string functions.
Theory Reference: Module 3, T1:Pg.No - 665
8 Program 8:
Title: Design and Develop a C program using pointers to compute the sum, mean and
standard deviation of all elements stored in an array of n real numbers.
Problem Description: The program should prompt the user to input the number of elements
n and the array elements. Using pointer arithmetic and mathematical formulas, the program
should calculate the sum, mean, and standard deviation of the array elements. 3
Method: Use pointers and pointer arithmetic to access and process array elements, then
apply mathematical formulas to compute the sum, mean, and standard deviation.
Theory Reference: Module 4, T1:Pg.No – 557
9 Program 9:
Title: Write a C program that copy the contents of the source file to the target file.
Problem Description: The program asks the user for the source and target text file names.
The contents are copied from the source to the target file character by character.
4
Method: Use file I/O functions to open the source and target files, read the source file
character by character using fgetc(), and write each character to the target file using fputc()
until the end of the file is reached.
Theory Reference: Module 4, R1:Pg.No – 434
10 Program 10:
Title: Design and Develop a C program to implement structures to read, write, compute
average- marks and the students scoring above and below the average marks for a class of
N students.
Problem Description: The program should prompt the user to input details for each student,
such as their name and marks for different subjects. Then, it should calculate the average
3
marks for the entire class and identify students who scored above and below this average.
Method: Use structures to store each student's details including name and marks, compute
the class average by iterating through the structure array, and compare each student’s marks
to classify them as scoring above or below the average.
Theory Reference: Module 5, T1:Pg.No – 557

Suggested Learning Resources:


Textbooks:
1. Behrouz A. Forouzan and Richard F.Filberg, “Computer Science A structured programming
approach using C”, Third Edition, Cengage Learning, 2006.

9
Reference Books:
1. Computer fundamentals and programming in c, “Reema Thareja”, Oxford University, Second
edition, 2017.
2. E. Balaguruswamy, Programming in ANSI C, 7th Edition, Tata McGraw-Hill. 2. Brian W.
Kernighan and Dennis M. Ritchie, The ‘C’ Programming Language, Prentice Hall of India.
3. Brian W. Kernighan and Dennis M. Ritchie, The ‘C’ Programming Language, Prentice Hall of
India.
Web links and Video Lectures (e-Resources):
1. Introduction to Programming in C by Prof. Satyadev Nandakumar
https://onlinecourses.nptel.ac.in/noc20_cs91/preview
2. https://www.geeksforgeeks.org/cpp-preprocessor-directives-set-2/
3. Introduction to Programming in C by Prof. Satyadev Nandakumar
e-link: Introduction to Programming in C – Course (nptel.ac.in)
Activity-Based Learning (Suggested Activities in Class)/ Practical Based learning
1. Seminars on related topics.
2. Frequent quizzes on the taught topics.
3. Mini Projects.

Course outcomes: At the end of the course, the student will be able to
Apply C programming fundamentals and develop basic algorithms to solve simple computational
CO1
problems.
CO2 Design modular solutions by implementing control structures and decomposing problems into reusable
functions.
Utilize appropriate data structures such as arrays, strings, structures, unions and pointers to create
CO3
efficient C programs.
implement file handling operations and apply preprocessor directives in C to develop efficient and
CO4 modular solutions for real-world applications.

CO-PO Mapping:
CO/PO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3
CO1 2 3 2 - - - - - - - - - 3 - -
CO2 2 3 2 - - - - - - - - - 3 - -
CO3 2 3 2 - - - - - - - - - 3 - -
CO4 2 3 2 - - - - - - - - - 3 - -

High-3, Medium-2, Low-1

10

You might also like