You are on page 1of 2

CSN 104 COMPUTER PROGRAMMING

1st Year (All Branches)


Practical assignment-5
Arrays
1. Write a program to find the sum of elements of one dimensional array.
2. Write a program to find the sum of elements on both diagonals of square matrix.
3. Write a program to find the sum of even and odd numbers that appear in the matrix.
4. Write a program to find the smallest and the largest number among the 2D array.
5. Write a program to find the sum of elements of principal diagonal of square array.
6. Write a program to display the upper triangular matrix.
7. Write a program to display the lower triangular matrix.
8. Write a program to reverse the 1Dimensional array.
9. Write a program to delete an element from the specific location of an array.
10. Write a program to find the transpose of the matrix.
11. Write a program to add two matrices of the same order.
12. Write a program arrange the elements of an array in ascending order.
13. Write a program to multiply two matrices.
14. Write a program to check if the given matrix is symmetric or not.
15. Write a program to check if the particular element exists in the matrix and also
display the location of element.
16. Program to display array elements with their addresses
17. Program to display the elements of two arrays and their corresponding elements sum.
E.g if two arrays are defined as array1[ ]={1,2,3,4,5}, array2[ ]={1,2,3,4,5} then
resulting array should be array3[ ]={2,4,6,8,10}
18. Program to merge two arrays into third one. Display contents of all the three arrays

CSN 104 COMPUTER PROGRAMMING


1st Year (All Branches)
Practical assignment-6
Functions
1. Write a program to build a function which swaps two numbers entered by the user.
2. Write a program to develop a function to find the largest of three numbers (call by
value).
3. Write a function to find the sum of digits of a given number entered by the user.
4. Write a function to implement ab where a and b are integers (use math function).
5. Write a program to simulate a four function calculator.
6. Write a program to build a function which checks whether a number is prime or not.
7. Write a function to generate first n Fibonacci series where n is entered by the user and
pass it as an argument to a function.
8. Write a function to find the GCD of three numbers entered by the user. (recursion)
9. Write a recursive function to find the factorial of a number of users choice.
10. Write a function to read a number in binary form and converts it into hexadecimal
form.
11. Write a function to find the sum of all elements of a matrix (passing arrays to
function).
12. Write a function to find the standard deviation of n numbers by passing an array to
function.
13. Write a function arrange the numbers entered by the user in an ascending order.
14. Write a function to evaluate the series:
1-x2/2!+x3/3!-x4/4!.........upto given number of terms
Use a function to compute the factorials.
15. Write a recursive function for computing the values of (xn) given x and n as input
arguments.