104 CPPM LabGuide 2024
104 CPPM LabGuide 2024
104 : CPPM
FYBCA (Sem 1)
A&B&C
Lab Guide 2024
Week 1 : Basic Programs
1. Write a program to print message “Hello”.
2. Write a program to accept two float numbers and display addition of them.
3. Write a program to perform all arithmetic operations on two integer no.s.
4. Write a program to find area of triangle. (area = 0.5 * b* h)
5. Write a program to find volume of cylinder (v=PI*r*r*h)
6. Write a program to calculate simple interest. (si = (p*r*n)/100)
7. Write a program to convert Fahrenheit from centigrade. ( f=1.8*c+32)
8. Write a program to accept number of days then convert it into months and
days.
9. Write a program to accept distance between two cities in kilometers. Then
convert and print this distance in meters, centimeters , feets and inches.
10. Write a program to calculate 20% discount on purchase amount.
11.Write a program to swap two numbers.
12.Write a program to swap two numbers without using third variable.
A=a+b
B=a-b
A= a-b
13.Write a program to accept three subject marks and display total and
percentage.
14.Write a program to calculate net salary of employee.
Net salary = Gross salary – Deduction
Gross salary = Basic + DA + HRA + Medical
Deduction = Insurance + PF
DA = 90 % of basic
HRA = 34 % of basic
Medical = 10% of Basic
Pf = 8% of gross salary
Insurance = 6% of gross salary
15. Write a program if the total selling price of 15 items and total profit earned
on them is inputted through the keyboard. Then find the cost price of one
item.
Extra Programs :
➢ Write a program to calculate perimeter of rectangle. ( P = 2*l*b)
➢ Write a program to find volume of cube. (volume = l*b*h)
➢ Write a program to calculate circumference of circle. (2*PI *r)
➢ Write a program to read time in hour then convert and display in minutes
and seconds.
➢ Write a program to calculate 10% bonus of your salary.
101 – 300 Rs. 75 plus Rs. 1.00 per unit excess of 100
301 – 500 Rs. 275 plus Rs. 1.50 per unit excess of
300
500 and above Rs. 575 plus Rs. 1.75 per unit excess of
500
Write a program that read customer number & power consumed and prints
the amount to be paid by the customer. Note that output should be well
formatted.
Extra Programs :
➢ Write a program that accept two numbers and check they are equal or not?
➢ Write a program that accept two numbers then check addition of two
numbers is less than 25 or not?
➢ Write a program that enter employee name, year of joining and current
year. If the year of service are greater than 3 then give bonus of Rs. 3000,
then print salary of employee of this year.
➢ Write a program to read a number from 1 to 7 and accordingly it should
display MONDAY to SUNDAY. ( Using switch-case )
Week 5 : Series
40.Write a program for: 12 + 22 + 32 +42 +……+ n2
41. Write a program for: 1 + 4 – 9 + 16 – 25 + 36 ……+ n2
42. Write a program for: 1 + 2 + 4 + 8 + 16 + 32 +……..n terms
43. Write a program to generate Fibonacci series 0 1 1 2 3 5 8………
44. Write a program to print the series: 2, 10, 30, 68, 130,……..
45. Write a program to print the series: 1, -2, 3, -4, 5, -6, 7,……..
Week 6 : Pattern
46. 47. 48.
* * 1
** ** 1 2
*** *** 1 2 3
**** **** 1 2 3 4
49. 50. 51.
1 $$$$$ 54321
12 $$$$ 4321
123 $$$ 321
1234 $$ 21
$ 1
52. 53. 54.
1 5 55555
21 54 4444
321 543 333
4321 5432 22
54321 54321 1
55. 56. 57.
1 1 1
22 22 12
333 333 123
4444 4444 1234
55555 55555 12345
84.Write a program to accept a string e.g. INDIA and then print it as:
A
IA
DIA
NDIA
INDIA
85.Write a program to accept a string e.g. INDIA and then print it as:
INDIA
NDI
D
Week 10 : Pointer
89.Write a program to accept 10 numbers and calculate the sum of them using
pointer.
90.Write a program to accept 10 numbers and sort them with use of pointer.
97.Write a program that accept five strings and then count total no. of strings
without alphabet ‘A’.