Vous êtes sur la page 1sur 3

ANNUAL PRACTICALS PROGRAM LIST.

1. Write a C++ program with user defined function to accept 2d array and its size as
argument , and assign the elements into a 2-d array of integers in the following 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 array and
copy it to a 1 dimensional 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 search and display its
position.

7. Write a C++ program with user defined function to display transpose of a matrix.

8. Write a C++ program with user defined function for addition of two matrixes.

9. Write a C++ program with user defined function for multiplication of two matrixes.

10. Write a C++ program with user defined function to find the sum of boundary and non-
boundary elements of a matrix.
11. Write a C++ program with user defined function to find the sum of negative elements
of right and left diagonals of a matrix.

12. Write a C++ program with user defined function to print the upper triangle of a matrix.

13. Write a C++ program with user defined function to print the lower triangle of a matrix.

14. Write a C++ program with user defined function that exchanges the value of first half
elements with the second half elements of the array.
For example:

6 8 10 12 1 3 5 7

1 3 5 7 6 8 10 12

15. Write a C++ program with user defined function to accept a string and count the
number of vowels and words present in that string.

16. 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 , replace it with ' $ ' and display
that string.

17. Write a C++ program with user defined function to accept a string and print the
reverse of every word in the string.

18. Write a C++ program with user defined function to find the sum of rows of a given
matrix and display it.

19. Write a C++ program with user defined function to find the product of columns of a
given matrix and print it.

20. Write a C++ program with user defined function to accept two one dimensional arrays
and store the product in a two dimensional array.

A = 1,2,3 b = 1,2,3 c= 1,2,3

2,4,6

3,6,9

21. Write a C++ program with user defined function to accept a string and check whether
the string is a palindrome or not.
22. 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 blank space).

23. Write a C++ program with user defined function to find the largest and second largest
element in a given 1D array.

24. Write a C++ program with user defined function to find the smallest and second
smallest element in a given 1d array.

25. Write a C++ program with user defined function to find the subtraction of two
matrices.

26. Write a C++ program with user defined function to find the number of prime and
composite numbers present in the given 1D array.

27. write a C++ program with user defined function to print the n letter word in the given
string.

28. Write a C++ program with user defined function to count the number of names that
starts with vowel in a given 2D array of characters.

29. Write a C++ program with user defined function to shift the elements of the given 1D
array one position left.

If the array is 10 20 30 40 50

Then the array should be 50 10 20 30 40

30. Write a C++ program with user defined function to shift the elements of the given 1D
array one position right.

If the array is 10 20 30 40 50

Then the array is 20 30 40 50 10

Vous aimerez peut-être aussi