0% found this document useful (0 votes)
78 views

Assignment-2 Computer Programming UCT-145) : Date of Allocation of Assignments Date of Submission of Assignments

1. The document outlines an assignment for a computer programming course divided into 7 groups with 5 programming tasks each. 2. The tasks include programs to work with arrays, strings, matrices, recursion, sorting, searching and other basic programming concepts. 3. Students must submit their solutions to the assigned tasks by October 22nd.

Uploaded by

Bashi Randhawa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views

Assignment-2 Computer Programming UCT-145) : Date of Allocation of Assignments Date of Submission of Assignments

1. The document outlines an assignment for a computer programming course divided into 7 groups with 5 programming tasks each. 2. The tasks include programs to work with arrays, strings, matrices, recursion, sorting, searching and other basic programming concepts. 3. Students must submit their solutions to the assigned tasks by October 22nd.

Uploaded by

Bashi Randhawa
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Assignment-2

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

a. What would be the value of the expression p + 3


b. What would be the value of the expression *(Values + 5)
c. What would be the value of the expression p[2] + Values[5]
4. Write a program in C to find the LCM of two numbers using recursion.
5. Write a Program to Find Substring Of String Without Using Library Function. !!!
3 Group 1. Write a program in C to multiply two matrix using recursion.
C 2. Write a Program to Find Inverse Of 3 x 3 Matrix in 10 Lines.
3. Write a Program to read integers into an array and reversing them using pointers.
4. Write a program to Delete all occurrences of Character from the String.
5. Write a program in C to find the Hailstone Sequence of a given number.
4. Group 1. Write a program to accept a series in an array from the user now test the series to
D find out whether it is an Arithmetic progression, Geometric progression or none?
2. Write a Program to find addition of Lower Triangular Elements in C Programming.
3. Write a program in C to sort an array using Pointer.
4. Write a Program to Find the Largest & Smallest Word in a String.
5. Write aProgram to Find the Frequency of the Word ‘the’ in a given Sentence.
5 Group 1. Write aprogram to compare 2 arrays whether they are equal or not.
E 2. Write a program in C to check whether two given strings are an anagram.
3. Write a Program to change the value of constant integer using pointers.
4. Write a Program to multiply two Matrices by Passing Matrix to a Function.
5. Write a Program to find the Nth Fibonacci Number using Recursion.
Group 1. Write aProgram to Sort the Array in an Ascending Order.
6 F 2. Write aProgram to find the Biggest Number in an Array of Numbers using Recursion.
3. Write aProgram to count vowels and consonants in a string using pointer.
4. Write aProgram to Print Smallest and Biggest possible Word which is Palindrome in a
given String.
5. Write a Program to Solve the Magic Squares Puzzle without using Recursion.
Group 1. Write aProgram to demonstrate example of double pointer (pointer to pointer).
7 G 2. Write a program in C to check armstrong and perfect numbers using the function.
3. Write aProgram to Print the Alternate Elements in an Array.
4. Write a program in C to convert decimal number to binary number using the
function.
5. Write aProgram to Find the Number of Non Repeated Elements in an Array.

You might also like