MAHARANA INSTITUTE OF PROFESSIONAL
STUDIES (349), KANPUR
(Approved by AICTE, New Delhi and Affiliated to AKTU, Lucknow
LAB FILE
Academic Year: 2023-24
(Department of Computer Science and Engineering)
Lab Name : Programming for Problem Solving.
Lab Code : BCS 151
Course :B.Tech.
Branch/Section :………………………………..……
Semester :…ODD(I)……………………..…
Lab Faculty :Mr ALOK DWIVEDI
Name of Student :……………………………………
Roll No :……………………………………
INDEX
(Programming for Problem Solving) BCS 151
S.N Date of Remark/
Name of Program
o Experiment Sign
1 WAP in C to calculate Simple interest.
2 WAP in C to convert temperature in Celsius to Fahrenheit.
3 WAP in C to find the roots of a quadratic equation.
4 WAP to calculate the energy by equation:
Energy = [mass X acceleration X height + mass X velocity2/2]
5 Write a C program to swap variable values of i and j using
temporary variable.
6 Write a C program to swap variable values of i and j without using
temporary variable.
7 WAP in C to check a number is odd or even.
8 WAP in C to find greatest number among three numbers using
nested if else.
9 WAP in C to calculate division according to percentage.
10 WAP in C to print name of month according to input
11 WAP in C to find odd or even using switch statement.
12 Write a menu driven program in C with the following options-
A. Find greater between two numbers.
B. Check, number is even or odd.
C. Calculate area of Circle.
D. Exit
13 WAP in C to print Fibonacci series up to 10 terms.
14 WAP in C to check whether the given number is prime or not.
15 WAP in C to check whether the given number is Armstrong or not.
16 WAP in C to print sum of 12+23+34………
17 Write a C Program to evaluate the following series.
S=x + x3 + x5 + x7.....into given numbers of terms.
18 Write a C Find Sum of Series
Sum=x+x2/2! +x4/4!+x6/6! +…
19 Write a program to print the following pattern:
AAAA
BBB
CC
D
20 Write a program to print the following pattern:
1
23
456
7 8 9 10
21 Write a program to print the following pattern:
*
**
***
****
*****
22 WAP in C to check whether a given number is Prime or not using
function.
23 With a recursive function obtain the Fibonacci sequence up to 20
terms-- i.e. – 0 1 1 2 3 5 8 13 21 34 55 89……..
24 WAP in C to swap two number using functions.
i. Call by value
ii. Call by reference
25 WAP in C to find the greatest number in an array.
26 WAP in C to search element from an array and print the location
of the element using linear search approach.
27 WAP in C to search element from an array using Binary Search.
28 WAP in C to multiply two matrices.
29 WAP in C to sort n elements of an array in ascending order using
Bubble sort.
30 WAP in C to sort n elements of an array using Selection sort.
31 WAP in C to check whether given string is palindrome or not.
32 WAP in C to find the length of a string without using function.
33. Create a structure EMP for 100 employees with the members
name, department, address and salary. Where the address member
is itself a structure with the members house no, street, city, state
and pin code. Now print the name, address and salary for the
mechanical department.
34. WAP in C to find the sum of squares of n elements using malloc()
or calloc() functions.
35. WAP in C create a file a.txt store the data in it and copy the
contents into b.txt.
36. Create a file as NUM and store any 2 integers in this file. Now
create two more files named as EVEN and ODD here we will be
storing the even and odd numbers from the NUM file and display
the contents of these files.