Sie sind auf Seite 1von 1

Computing Laboratory

Lab Exercise 6
Indian Institute of Technology, Patna
Assignments for Group-3
February 11, 2015
To get started, create a directory called <your roll no>_CS110_lab6. Create all your
program files in that directory. On the top of each of the file write your name and roll number as
comments. At the end of the class make a zip file of your folder and submit it to
Go to the parent folder of your folder. Zip your folder by following command. zip -r
<filename>.zip <foldername>.
You may need to transfer that zip file to your local machine and then submit that to the specified
Please write proper comments in your program. Your comments must explain all the logics of your
EXERCISE 1: Write a C program to sum the elements of an array of int. Take the size of the array and
the integers from the user.
EXERCISE 2: Write a C program to find sum of two matrix of order 2*2 using multidimensional arrays
where, elements of matrix are entered by user.
EXERCISE 3: Write a C program to copy the content of one array to another array (any kind of array).
EXERCISE 4: Write a C program to merge two arrays into one array.
EXERCISE 5: Write a C program to find the smallest and the largest element in an array of numbers.
EXERCISE 6: Write a C program to print the transpose of a square matrix.
EXERCISE 7: Write a C program to check whether a square matrix is a magic square or not.

Extra Problems:
EXERCISE 8: Write a C program to delete all the duplicates from an array of numbers. After deleting
a duplicate all the numbers on the right should be shifted one position to the left.
EXERCISE 9: Write a C program to calculate matrix multiplication. Take the dimensions of the two
matrices from the user. Check whether they are compatible for matrix multiplication. Take the
values in the matrix using random numbers (you have used rand() function in ex.6 of Lab 4, if you
have not done it then do it now). Print the resulting matrix.
EXERCISE 10: Write a C program to find the inverse of a matrix.