0% found this document useful (0 votes)
44 views10 pages

104 CPPM LabGuide 2024

Uploaded by

Ujval Sharma
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)
44 views10 pages

104 CPPM LabGuide 2024

Uploaded by

Ujval Sharma
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/ 10

D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

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

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 1


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

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.

Week 2 : if and switch statement


16. Write a program that accept a number and check it is 5 or not?
CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 2
D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

17.Write a program that check the given number is divisible by 7 or not?


18.Write a program that find minimum from two numbers.
19. Write a program that accept an age and find the person is eligible for
voting or not?
20. Write a program that check whether the triangle is valid or not?
21.Write a program that enter quantity and price of per item from user. If
quantity price is more than 1000 then special discount of 10% is offer. Find
total bill amount and print it.
22.Write a program that find maximum from three numbers. (logical operator)

23.Write a program to read marks from keyboard and display equivalent


grade. ( Using if-else if ladder )
Marks Grade
100-80 Distinction
60-79 First Class
35-59 Second Class
0-34 Fail
24.Write a program that accept person gender and age. Then find he or she is
eligible for marriage or not?
25.Write a program to accept account number, transaction type and amount
of transaction from the user. If transaction type is D then amount is
deposited to bank and it is added to total balance. If transaction type is W
then amount is withdrawn from bank and it is deducted from total balance.
Print account number and total balance.

26. Write a program to make simple calculator using switch.


27. A electric power distribution company charges its domestic consumers as
follows:
CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 3
D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

Consumption Units Rate of Charge

0 – 100 Rs. 0.75 per unit

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 3 : looping statement


28.Write a program to display all even numbers upto given number.
29.Write a program that display N even numbers.
30.Write a program that calculate average of first N even numbers. [do-while]
CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 4
D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

31.Write a program to find factorial of given number.


32.Write a program to accept height and weight of five persons then count the
number of persons having height greater than 170 and weight less than 50.
33.Write a program to calculate sum of the squares of each digit of the given
number. [4534 → 42 + 52 + 32 +42 = 66]

Week 4 : looping statement


34.Write a program to check the given number is palindrome or not.
35.Write a program to calculate the sum of first and last digit of the given
number.
36.Write a program to check whether the given number is perfect or not. [ A
number is perfect if its sum of digits is same as multiplication of digits ]
37.Write a program to check whether the given number is Armstrong or not. [
A number is Armstrong if sum of cube of every digit is same the original
number ]
38.Write a program to check whether the given number is prime or not.
39.Write a program to print all prime numbers between given range.

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,……..

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 5


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

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

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 6


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

58. 59. 60.


**** a z
*** ab zy
** abc zyx
* abcd zyxw
61. 62. 63.
1 1 1
23 01 1 4
456 101 1 4 9
7 8 9 10 0101 1 4 9 16

Week 7 : Numeric Single Dimensional Array


64.Write a program to print average (mean) of n numbers in 1-D array.
65.Write a program that will read the age of 10 students and then print the
total number of students having age greater than 20.
66.Write a program to print maximum and minimum element from 1-D array.
67.Write a program to count total number of odd and even elements from the
1-D array.
68.Write a program to check whether the entered number is present or not in
the 1-D array. If present then also print the occurrence of a entered
number.
69.Write a program to count total number of negative, positive and zero
elements from the 1-D array.
70.Write a program to remove duplicate elements from 1-D array.

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 7


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

Week 8 : Character Single Dimensional Array


71.Write a program to calculate length of the given string.
72.Write a program to count word in the given string.
73.Write a program to count vowels in the given string.
74.Write a program to count characters, digits and blankspaces in the given
string.
75.Write a program to convert the given string into togglecase.
76.Write a program to check whether the given string is palindrome or not.
77.Write a program to append the string. (Add one string to another )
78.Write a program to accept a name and print it as:
Input → Sachin Ramesh Tendulkar
Output → S. R. Tendulkar
Week 9 : Character Single Dimensional Array
79.Write a program to copy one string to another string.
80.Write a program to compare two strings. ( Case Sensitive)
81.Write a program to find occurrence (frequency) of each character in the
given string.
82.Write a program to calculate total number of capital, small and special
character in the given string.
83.Write a program to accept a string e.g. INDIA and then print it as:
I
IN
IND
INDI
INDIA

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 8


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

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

86.Write a program to increment the value of variable using pointer.

87.Write a program to add value of two variables using pointer.

88.Write a program to accept 10 numbers and print them using 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.

Week 11 : Pointer & 1-D Array

91.Write a program to read in an array of integers and print its elements in


reverse order using pointer.

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 9


D-UIAS AND D-SIM&C, VALSAD CPPM LAB GUIDE

92.Write a program to receive a sorted array of integers and an integer value


and inserts the value in its correct place using pointer.

Week 12 : Pointer & String

93.Write a program to count number of alphabets in a given string using


pointer.

94.Write a program to copy a string into another string using pointer.

95.Write a program to concate two strings using pointer.

96.Write a program to sort the n strings using pointer.

97.Write a program that accept five strings and then count total no. of strings
without alphabet ‘A’.

CREATED BY : DR. DARSHNA RAJPUT & DR. AKRUTI NAIK 10

You might also like