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

Lab Manual

Uploaded by

adis6469
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)
19 views5 pages

Lab Manual

Uploaded by

adis6469
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
You are on page 1/ 5

Programming for Problem Solving Lab (KCS151P) 2022-

23

LIST OF EXPERIMENTS

CATEGORY PROGRAM TITLE CO


NO
BASIC INPUT 1. Write a program to input and add two numbers CO1
OUTPUT
OPERATIONS 2. Write a program to convert Fahrenheit to Celsius and Celsius CO1

to Fahrenheit.

3. Write a program to calculate Area of a rectangle CO1


4. Write a program to Calculate Area and Perimeter of a CO2
Circle
5. Write a program to determine the roots of quadratic equation CO2

6. Write a program to Calculate Simple Interest

7. Write a program to Calculate Compound Interest

8. Write a program to swap two numbers using third variable,

without using third variable, within single statement using

comma operator.

9. Write a program to input two numbers and find the greatest

number using ternary operator.

10. Write a program to find odd/even number using ternary

operator.

11. Write a program to Input three numbers and find greatest

number using ternary operator.

12. Enter arithmetic operator from user, perform operation on

two numbers according to the operator using ternary

operator.

13. Find odd/even number using bitwise operator.

G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 1
Programming for Problem Solving Lab (KCS151P) 2022-
23

14. Write a program to swap two numbers using bitwise

operator.

15. Find exact power of 2 of a given number using bitwise

operator.

CONDITIONAL 1 Write a program to input the annual taxable income and CO2
& SWITCH compute the tax according to the given condition.
CASE
STATEMENTS
Total Annual Taxable Tax Rate
Income

Up to Rs. 1,00,000 No Tax

From 1,00,001 to 10% of the income tax


1,50,000 exceeding Rs. 1,00,000

From 1,50,001 to Rs. 5000 + 20% of the


2,50,000 income tax exceeding
Rs. 1,50,000

Above 2,50,000 Rs. 25000 + 30% of the


income tax exceeding
Rs. 2,50,000

2 Write a program to calculate the monthly telephone bills as


per the following rule.
 Minimum Rs. 100 for up to 50 calls
 Plus Rs. 0.80 per call for next 50 calls
 Plus Rs. 0.60 per call for next 100
calls
 Plus Rs. 0.40 per call for any call be-
yond 200 calls

3 Write a currency program that tells you how many


500,200,100,50,20,10,5,2 and 1 Rs. notes will be needed
for a given amount of money.
LOOP 1 Write a program, enter a number from user check that
G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 2
Programming for Problem Solving Lab (KCS151P) 2022-
23

CONSTRUCT number is prime or not.


2 Write a program, enter a number from user reverse that
number.
3 Write a program, enter a number from user check that is
number is Armstrong or not.
4 Write a program to find out the value of x raised to the
power y, where x and y are positive integers
CO2

5 1
01
101
0101
10101
6 * CO2

* *
* * *
* * * *

7 1 CO2

232
34543
4567654
567898765
4567654
34543
232
1
USER DEFINE 1 Write a program to print out all the Armstrong number
FUNCTION between 100 and 500 using user define function.

2 Write a program to print the entire prime no between 1 and


300 using user define function.
3 Write a program to find sum of Fibonacci series up to N CO2
(where N is entered through keyboard) using function

RECURSION 1 Write a program to calculate the GCD of given numbers


using recursion
2 Write a program to find the sum of digits of a 5 digit number using
recursion.
G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 3
Programming for Problem Solving Lab (KCS151P) 2022-
23

ONE 1 Write a program, enter n elements into an array, perform


DIMENSION linear search
INTEGER
ARRAY
2 Write a program, enter n elements into an array, perform
binary search.
3 Write a program, enter n elements into an array, perform
reverse operations
4 Write a program to delete duplicate element in a list of 10 elements CO4
&display it on screen.

5 Write a program to merge two sorted array & no element is CO4


repeated during merging.

TWO 1 Write a program to evaluate the addition of diagonal elements of CO4


DIMENSION two Square matrices.
INTEGER
ARRAY 2 Write a program to find the transpose of a given matrix & check CO4
whether it is symmetric or not.
3 Write a program to print the multiplication of two N*N (Square) CO4
matrix.

STRING 1 Write a program in C to check whether the given string is a CO4


palindrome or not.

2 Write program to sort the array of character (String) in CO4


alphabetical order like STRING in GINRST.
3 Write a program to remove all the blank space from the string & CO4
print it, also count the no of characters.

4 Write a program to store the following string “zero”, “one” ------- CO4
“five”. Print the no in words, given in figure as 3205.

STRUCTURE 1 Write a union program to extract individual bytes from an un- CO4
& UNION signed int. (for hexadecimal value)

2 Define a structure that can describe a hotel. It should have the CO4
member that includes the name, address, grade, room charge and
number of rooms. Write a function to print out hotel of given grade
in order of room charges.
3 Define a structure called cricket with player name, team name, CO4
batting average, for 50 players & 5 teams. Print team wise list
contains names of player with their batting average.

FILE 1 Write a c program to copy & count the character content of one file CO5
HANDLING says
a.txt to another file b.txt.

2 Write a program to take 10 integers from file and write square of CO5
these
integer in other file.

3 Write a program to read number from file and then write all ‘odd’ CO5
number

to file ODD.txt & all even to file EVEN.txt.

G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 4
Programming for Problem Solving Lab (KCS151P) 2022-
23

4 Write a program to print all the prime number, between 1 to 100 in CO5
file
Prime.txt.

GRAPHICAL 1. Write a program to draw circle, line, rectangle fill with red color.
OPERATIONS 2. Draw a moving cycle using computer graphics programming in C.

10 1 Write a C program to find the largest no among n integers array CO5


using dynamic memory allocation.

2 Using Dynamic Memory Allocation, Write a C program to find the CO5


transpose of given matrix.
3 Write a program to find the factorial of given number using CO5
command line argument.
4 Write a program to find the sum of digits of a 5 digit number using CO5
command line argument.

G.L. BAJAJ INSTITUTE OF TECHNOLOGY & MANAGEMENT, GR. NOIDA, DEPT. OF MCA Page 5

You might also like