Birla Institute of Technology, Mesra, Ranchi
CS24102 PROGRAMMING FOR PROBLEM SOLVING LAB
ASSIGNMENT
Class: BTech II Semester SP-2025
Sl. Experiment Day
No.
1 Write a program (WAP) to compute the average of a set of user specified 1
numbers.
2 WAP to find maximum and minimum values in a set of user specified 1
numbers.
3 WAP to compute area and circumference of a circle and produce formatted 1
output.
4 WAP to compute all roots of a quadratic equation and produce formatted 1
output.
5 WAP to print Fahrenheit temperatures and their centigrade or Celsius 2
equivalents with step size of 10 in well formatted and tabular form.
6 WAP to that counts characters, words and lines in a user specified paragraph. 2
7 WAP for simple calculator using case statements. 2
8 WAP to find the area of circle, square, rectangle and triangle using case 2
statements.
9 WAP to compute grades of students using nested if statements as per the 2
following range of marks:
90 and above: A+, 80-89: A, 70-79:B, 60-69:C, 50-59:D, 40-49:E, Below 40:F
10 A number is called an Armstrong number if the sum of the cubes of the digits 3
of the number is equal to the number. For example, 153 = 1^3 + 5^3 + 3^3.
WAP that asks the user to enter a number and check if it is Armstrong or not.
11 WAP that calculates the HCF and LCM of two numbers. 3
12 Write a program in C that takes as input a set of numbers and calculates the 3
mean, variance and standard deviation. (variance is defined as Σ [(xi - x)^2]/n -
1 , where xi =ith number in the set, x is the mean and n=cardinality of the set ;
standard deviation is the square root of variance).
13 WAP to find and display the sum of the series 1+11+111+....111 up to n (user 3
specified) terms.
14 WAP to compute and display the binary representation of a user specified 3
positive integer n.
15 WAP to find the reverse of an integer number. 4
16 WAP to generate Fibonacci series up to n terms. 4
17 WAP to find the value of sin(x) using the series up to the given accuracy and 4
also display sin(x) using library function.
18 WAP which will display two-digit numbers whose sum of both digits are 4
multiple of eight.
19 WAP to input n numbers in an array, calculate the sum of all even numbers 4
and all odd numbers in the array and display the larger sum.
20 WAP to sort an array of integers using bubble sort. 5
21 WAP to accept 10 values in an integer array. Display the number of odd, even, 5
and negative numbers.
22 WAP to accept 10 values in an integer array. Display the number of odd, even, 5
and negative numbers.
23 WAP that reads list of n integer and display sum of product of consecutive 5
numbers.
24 WAP that takes a list of n elements from the user. Store it in an array. Reverse 5
the list.
25 WAP to check whether a given string is palindrome or not. 6
26 WAP with two different functions to compute area and perimeter of a triangle 6
whose sides a, b, and c are given by user as inputs. Your program should read
the input data and print the output data via separate functions.
27 WAP to input size and values in two arrays A and B of max size 100. Then, 6
compute A[i]+B[i] and store in array C. Also compute A[i]*B[i] and store in
array D. Display arrays C and D.
28 WAP to display multiplication table for numbers 1 to 5 using 2-D array. 6
29 WAP with a function power that computes x raised to the power y for integers 6
x and y and returns double-type value.
30 WAP that passes a three-element integer array to a function, where the array 7
elements are altered. The values of the array elements are displayed at three
different places in the program, thus illustrating the effects of the alterations.
31 WAP to calculate the standard deviation of an array of values. The array 7
elements are read from the terminal. Use functions to calculate standard
deviation and mean.
32 WAP that demonstrates the use of string handing function functions strlen(), 7
strcpy() , strcat() and strcmp().
33 WAP to sort a list of strings alphabetically using a two-dimensional character 7
array.
34 WAP to demonstrate the use of global, static and extern variable. 7
35 Define a structure type, struct personal that would contain person name, date 8
of joining and salary. Using this structure, write a program to read this
information for one person from the keyboard and print the same on the
screen.
36 WAP to declare the members (day, month, year) of structure using bit field 8
datatype and to display the contents (date) and size of the structure.
37 WAP to illustrate the comparison of structure variables. 8
38 WAP to illustrate the method of sending an entire structure as a parameter to a 8
function.
39 WAP that accepts the roll number, name and marks obtained in five tests of 8
five students of a class and displays the roll number, name, marks of five tests
and average. Use the concept of array of structure.
40 WAP to define a structure with members name, account number, account type 9
and balance for 5 customer records using typedef and to find a customer
record that corresponds to a specified account number.
41 WAP to illustrate the relationship between array elements and their addresses 9
using pointer.
42 WAP to illustrate the operation on a pointer variable. 9
43 WAP to find the sum of elements of an array using the concept of pointer and 9
function.
44 WAP to swap the values of the two variables using a function with call by 9
reference.
45 WAP with a function that counts the number of vowels, consonants, digits, 10
whitespace characters, and "other" characters in a line of text using pointer
and array.
46 WAP to reorder a one-dimensional, integer array from smallest to largest, 10
using pointer notation.
47 WAP that accepts two one-dimensional arrays and finds the sum of the 10
corresponding elements, and this sum is stored in the third array using pointer.
Finally, it prints the resultant array.
48 WAP that allows an unspecified number of parameters to be entered from the 10
command line. When the program is executed, it display the current value of
main() arguments.
49 WAP that reads a line of text from a data file on a character-by-character basis 10
and displays the text on the screen. The file name is entered as a command
line parameter.