You are on page 1of 3

COMPUTER PROGRAMMING

ASSIGNMENT
SUBMISSION DATE: 17 JAN, 2011
TH

Note: - Implement all problems using Functions

1. Write a program using 2-dimensional array that will ask user to enter values in
the array. Then print the maximum and minimum values of each column of the
array. Array will have three rows and three columns.

2. Write a program using 2-dimensional array that will ask user to enter values in
the array. Then print the array in reverse order. Array will have four rows and
four columns.

3. Write a program using 2-dimensional array that will ask user to enter a number.
You have to store the table of that number up to 10 in the array.1st column will
store the count, and 2nd index will store the table. After this display the array.
Array will have 10 rows and 2 columns.

4. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the arrays. After this store the product of both the arrays in a
third array. Multiply (4 X 3) and (3 X 4) matrices. The resultant matrix will be (4
X 4). Also display the resultant matrix.

5. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the arrays. After this store the product of both the arrays in a
third array. Multiply (3 X 2) and (2 X 4) matrices. The resultant matrix will be (3
X 4). Also display the resultant matrix.

6. Write a program using 2-dimensional array that will ask user to enter values in
the array. Your task is to sort the array in ascending or descending order
depending upon the user’s choice. Array will have three rows and three columns.

7. Write a program using 2-dimensional array that will ask user to enter values in
the array. Your task is to sort each individual row of the array in ascending
order. Array will have three rows and three columns.

8. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the array. Your task is to replace the smallest value of the first
array with the smallest value of the second array, and the largest value of the
first array with the largest value of the second array. At the end, display both
the arrays.
9. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the arrays. Print the common elements of both the arrays. Array
will have four rows and four columns.

10. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the arrays. Print all the elements which are different in both the
arrays. Array will have three rows and three columns.

11. Write a program using 2-dimensional array that will store first nine prime
numbers of Fibonacci series in the array. Also display the array. Array will have
three rows and three columns.

12. Write a program using 2-dimensional array that will initialize all the indexes of
the array with 10. Then print the following sequence:

10
10 10
10

Array will have three rows and three columns.

13. Write a program using 2-dimensional array that will initialize all the indexes of
the array with 5. Then print the following sequence:

5 5 5 5
5 5
5 5
5 5 5 5

Array will have four rows and four columns.

14. Write a program in which you have two 2-dimensional arrays. Ask the user to
enter values in the arrays. Then replace the 1st row of 1st array with the 3rd row
of second array, the 2nd row of 1st array with the 2nd row of second array and the
3rd row of 1st array with the 1st row of second array. Also display both the arrays.
Arrays will have three rows and three columns.

15. Write a program to print the diagonal of a 2-dimensional array. Ask the user to
enter values in the arrays. For upper diagonal part, it has to print ‘*’ and for
lower diagonal part it has to print ‘#’. Array will have four rows and four
columns.

16. Write a program to print the upper diagonal of a 2-dimensional array. For lower
diagonal part, it has to print ‘$’ and for diagonal it has to print ‘@’. Array will
have four rows and four columns.
17. Write a program to print the lower diagonal of a 2-dimensional array. For upper
diagonal part, it has to print ‘!’ and for diagonal it has to print ‘&’. Array will
have four rows and four columns.

18. Write a program in which you have two 2-dimensional arrays. Both the arrays will
have digits from 1 to 9 stored in them. If any element of 1st array is a multiple of
2, replace it with 1, otherwise replace it with zero. Count how numbers in the
first array are multiples of 2. Also display those numbers. Similarly if any
element of 1st array is a multiple of 3, replace it with 1, otherwise replace it
with zero. Count how numbers in the second array are multiples of 3. Also
display those numbers and both arrays.

IMPORTANT INSTRUCTIONS:

1. Read the problems carefully.


2. Display all the 2-dimensional arrays in rows and columns.
3. For submission make a folder named your Reg. No. , paste
all the programs in it. The file names must be the question numbers.
4. Copy cases will get negative marks and it will badly affect
your grades.

- - - - GOOD LUCK - - - -

You might also like