Assignment-2 Computer Programming UCT-145) : Date of Allocation of Assignments Date of Submission of Assignments
Assignment-2 Computer Programming UCT-145) : Date of Allocation of Assignments Date of Submission of Assignments
Computer Programming
(UCT-145)
Date of allocation of Assignments 25-Sep-18
Date of Submission of Assignments 22-Oct-18
S Group Assignment
No.
1 Group 1. a) Write a program to accept 10 values in an integer array. Display the number of
A odd, even, and negative numbers.
b) Write a program to search a given element in an array.
2. For a given a two dimensional matrix of 0’s and 1’s find out the adjacent elements
that are similar to the current element in the given matrix and store the results in
another matrix?
Hint: Given matrix Solution matrix
1 1 0 1 1 1
0 0 1 1 2 1
1 1 0 1 2 1
Red is current cell. Blue cells are adjacent cells Green shows the solution to the red cell
above i.e number of adjacent cells
which have same value as the current
cell(red cell above)
3. Write a Program to Sort set of strings in alphabetical order using strcmp().
4. (a) Write a recursive function to find the power of a number.
(b) C Program to find Sum of Digits of a Number using Recursion.
5. Write a program in C to print all permutations of a given string using pointers.
2 Group 1. Write a program to count the occurrence of each element in a given array.
B 2. Write a C Program to Reverse Letter in Each Word of the Entered String.
3. The diagram below is