0% found this document useful (0 votes)
32 views

CS153Programming For Problem Solving Lab

Uploaded by

saiteja807482
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

CS153Programming For Problem Solving Lab

Uploaded by

saiteja807482
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS153 Programming for Problem Solving Lab

Lectures : 3 periods/week, Tutorial: 0 Sessional Marks : 30

University Exam : 3 hours University Examination Marks : 70

Course Objectives:
The objectives of the course are, to make the student understand:
1. Basic problem solving process using Flow Charts and algorithms.
2. Basic concepts of control structures in C.
3. Concepts of arrays, functions, pointers and Dynamic memory allocation in C.
4. Concepts of structures, unions, files and command line arguments in C.
Course Outcomes:
After successful completion of the course, the students are able to
1. Develop algorithms and flow charts for simple problems.
2. Use suitable control structures for developing code in C.
3. Design modular programs using the concepts of functions and recursion.
4. Develop code for complex applications using structures, pointers and file handling features.

Lab 1. a) Evaluate the arithmetic expression and display its solution


i) X= ((a -b / c * d + e) * (f +g))
ii) Y=8.8(a+b)/(g+h*c/d-e%f)
iii) R=(2v+6.22(c+d))/(g+v)
b) Write a C Program to exchange two numbers without temporary variable
usingArithmetic and bit – wise operators.
Lab 2. a) Write a program in C which is a Menu-Driven Program to compute the
perimeterand area of the various geometrical shapes (Square, Rectangle,
Triangle, and Circle).
b) Develop a C Program which counts the number of positive and negative
numbersseparately and also compute the sum of them.
c) Design a C program to print the sequence of numbers in which each number
is the sum of the three most recent predecessors. Assume first three
numbers as 0, 1,and 1.
Lab 3. a) Write a program in C to display the n terms of harmonic series and their
sum.1 + 1/2 + 1/3 + 1/4 + 1/5 … 1/n terms
b) Implement the C program which computes the sum of the first n terms
of theseries sum = 1 – 3 + 5 -7 +9
c) Design an algorithm and implement using a C program which finds the sum of the
infinite series 1 – x2/2! + x4/4! – x6/6! + ....
Lab 4. a) Design a C program which determines the numbers whose factorial values
arebetween 5000 and 32565.
b) Develop a C Program to determine given number is strong or not.
c) To print the four patterns using nested loops
Lab 5. Develop a menu driven program to compute statistical parameters (using
one – dimensional array):
a) Mean b) Median c) Variance d) Standard deviation e). Quit
Lab 6. Develop A menu driven program with options (using one -Dimensional
array using functions):
(a) To insert an element into array (b) To delete an element (c) To print elements
(d) To remove duplicates e) Quit
Lab 7. A menu driven program with options (using two dimensional array with
functions) (i) To compute A+B (ii) To compute A X B (iii) To find transpose of
matrixA Where A and B are matrices. Conditions related to size to be tested
Lab 8. A menu driven program with options (using Two-dimensional Character
arrays andfunctions)
(i) To insert a student name
(ii) To delete a name
(iii) To sort names in alphabeticalorder
(iv) To print list of names
Lab 9. Develop A menu driven program with options (using Dynamic memory
allocations function with pointers):
(a) To insert an element into array (b) To delete an element (c) To print elements
(d) Quit
Lab 10. a) Develop a program to compute the GCD of two numbers using recursion.
b) Develop a program to print the Fibonacci series using recursive function.
Lab 11. Develop A menu driven program with options (using Structures):
Create Structure with Complex tag name and its members are real and
imaginary withfloat types. (a) Complex Numbers Addition (b) Complex
Numbers subtraction
(c) Complex Numbers Multiplication (d) Quit
Lab 12. a) Implement a program in C to append multiple lines at the end of a text file.
b) Implement a program in C to copy a file in another file (using command-
linearguments)

You might also like