You are on page 1of 4

ANNUAL PRACTICALS PROGRAM LIST.....!!

1. Write a C++ program with user defined function to accept 2d array and its siz
e as argument , and assign the elements into a 2-d array of integers in the foll
owing format:
if the array is 1,2,3,4,5,6
the resultant array should be:
1 0 0 0 0 0
1 2 0 0 0 0
1 2 3 0 0 0
1 2 3 4 0 0
1 2 3 4 5 0
1 2 3 4 5 6
2. Write a C++ program with user defined function to replace repeating elements
in an array with zero.
Ex:10,20,30,10,40,20,30
The output will be 10,20,30,0,40,0,0
3. Write a C++ program with user defined function to display the sum of the odd
elements in the even positions in an array of integers.
4.Write a C++ program with user defined function to display the sum of the even
elements in the odd positions in an array of integers.
5. Write a C++ program with user defined function to accept a 2 dimensional arra
y and copy it to a 1 dimentional array column wise.
6. Write a C++ program with user defined function to accept an array of integers
and check whether the given element is present in that array using linear searc
h and display its position.
7. Write a C++ program with user defined function to accept an array of integers
and check whether the given element is present in that array using binary searc
h and display its position.
8. Write a C++ program with user defined function to display transpose of a matr
ix.
9. Write a C++ program with user defined function for addition and subtraction o
f two matrixes.
10. Write a C++ program with user defined function for multiplication of two mat
rixes.
11. Write a C++ program with user defined function to find the sum of boundary a
nd non-boundary elements of a matrix.
12. Write a C++ program with user defined function to find the sum of negative e

lements of right and left diagonals of a matrix.


13. Write a C++ program with user defined function to print the upper triangle o
f a matrix.
14. Write a C++ program with user defined function to print the lower triangle o
f a matrix.
15. Write a C++ program with user defined function that exchanges the value of f
irst half side elements with the second half side elements of the array.
For example:
6
1

10
3

12
5

1
7

3
6

5
8

7
10

12

16. Write a C++ program with user defined function to accept a string and count
the number of vowels and words present in that string.
17. Write a C++ program with user defined function to accept a string and check
whether the given character is present in that string , if it is present , repla
ce it with ' $ ' and display that string.
18. Write a C++ program with user defined function to accept a string and count
the number of words that starts with ' A ' or ' a '.
19. Write a C++ program with user defined function to find the sum of rows of a
given matrix and display it.
20. Write a C++ program with user defined function to find the product of column
s of a given matrix and print it.
21. Define a structure named result in C++ with the following descriptions:
Data members :
roll no-integer
name-string of 20 characters
subjects - integer array to store 6 subjects marks
total-integer
average-float
Member functions :
1.function get_value() to read the values for all the data members.
2.function show_value() to show roll no, name, total and average.
Write a C++ program to implement the above structure definition and displa
y the topper's details.
22. Write a C++ program with user defined function to accept a string no.of thr
ee letter word and five letter words in a given string
23. Write a C++ program with user defined function to accept a string and check
whether the string is palindrome or not
24. Define a structure employee with empno of type integer, empname of type stri
ng, designation of type string, designation of type string, salary of type float
with member functions to accept and display the employee record.
Write a C++ program to implement above structure and display if the sala
ry is above 5000 and his designation is manager.
25. Write a C++ program with user defined function to accept input for the name

of a person and check whether it is a valid name or not (first letter should be
a capital letter, it does not contain any numbers or special characters except b
lank space).
26. Declare a structure to represent bank account with the following data member
s. Name of the depositor, account (s for savings and c for current account), bal
ance amount. The structure also contains member functions to do the following:
(i) to accept data members
(ii) to deposit money
(iii) to withdraw money after checking the balance (minimum balance is Rs.10,000
)
(iv) to display the data members.
Write a C++ program to accept an array of customers and check whether he is goin
g to deposit or withdraw. Finally print the current balance of those customers.
27. Declare a structure donor with the following data members.
Donor number-integer type.
Name of the donor-string type
bloodgroup-string type.
Write a C++ program to accept an array of donors and display the details of the
O negative
donors.
28. Write a C++ program with structure carrental to display the details of c
ar with the following specifications:
Data Members:
Carid- integer
Carname-String type
Rent-Float type
Memberfunctions:
assign rent() to assign the following values for rent as per given the cartype
Car type
Rent
Small
1000
Van
800
SUV
2500
accept() In this function ,accept the details like carid,carname and call assign
rent() function.
display()-In this function display the details of car
29. Write a C++ program with structure society with the following specificat
ions:
Data Members:
Name of the society- String type
House no:integer
Flat type-3 characters
No.of.Members-Integer
Income-Float
Member functions:
getdata()-Function to read data members Name of the Society, house no, No.of.Me
mbers and income.
allocate() Function to allocate according to the income
Income
Flat type
>=10000

HIG
>=5000
MIG
<5000
LIG
display()-Function to display all the data members.
30. Write a C++ program with structure Flight with the following specificatio
ns
Data Member
Flight no:integer
Destination-String
Distance-Float
Member functions:
getdata()-Function to read data members Name of the flightno, Destination, Dist
ance and call function Cal fuel().
calfuel() Function to calculate value as per the following criteria.
Distance
Fuel
<=1000
500
More than 1000 and <=2000
1100
More than 2000
2200
display()-Function to display all the data members.

You might also like