TERMWORK_PCS_251_2023

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

TERM WORK COMPUTER LAB-II(PCS 251)

INSTRUCTION:
1. Use one side ruled bond sheets (Thick) for writing and DMP sheets for printouts.
2. Every solution must contain the following: - Problem statement, Assumptions, Algorithms,
Flowchart (back of ruled sheet), Printout of program and all possible outputs on separate sheets.
3. Margin should be drawn on flowchart sheet 2cm from right and 1cm from rest of the three sides.
4. Write your name, University roll no. and section with problem statement at the top of every code in
the comment section.

1. Write a user define function in C to print all unique elements in an array.

Test Data:
Print all unique elements of an array:
------------------------------------------
Input the number of elements to be stored in the array: 4
Input 4 elements in the array:
element - 0: 3
element - 1: 2
element - 2: 2
element - 3: 5
Expected Output:
The unique elements found in the array are: 3 5

2. Write a program in C to separate odd and even integers into separate arrays.
Test Data:
Input the number of elements to be stored in the array :5
Input 5 elements in the array:
element - 0: 25
element - 1: 47
element - 2: 42
element - 3: 56
element - 4: 32
Expected Output:
The Even elements are: 42 56 32
The Odd elements are: 25 47
3. Write a program in C to find the sum of the lower triangular elements of a matrix.

Expected Output:
The given array is:
123
456
789
The elements being summed of the lower triangular matrix are: 4 7 8
The Sum of the lower triangular Matrix Elements are: 19
4. Write a program in C to find the max element of each row of a matrix.
Expected Output:
The given array is:
123
456
789
The maximum element of each row of matrix are: 3 6 9

5. Write a program in C to split string by space into words.


Test Data:
this is a test string

Expected Output: Strings or words after split by space are:

this
is
a
test
string.
6. Write a user define function to find the highest frequency character in a string.

Test Data:
Welcome to graphic era

Expected Output: Highest frequency character appears in a string is e.

7. Write a program to remove characters from a string except alphabets.

Test Data:
graphicera1234@geu.ac.in
Excepted output: graphicerageuacin.

You might also like