LAB PSAP Problem Statements
LAB PSAP Problem Statements
E01
Given a string, S , consisting of alphabets and digits, find the number of
alphabets and digits in the given string.
Test Case 1:
Sample Input: a11472o5t6
Number of digits: 7
Number of alphabets:3
E02
Given a string s containing just the characters like:
'(', ')', '{', '}', '[' and ']', determine if the input string is valid.
An input string is valid if number of opening and closing brackets is same
(irrespective of the sequence of opening and closing brackets)
Test Case 1:
Sample Input: ( )
Sample Output: Valid
Test Case 2:
Sample Input: ( )[ ]{ }
Sample Output: Valid
Test Case 3:
Sample Input: ( [ { }
Sample Output: Invalid
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E03
Given a string s, perform following operations on a string using function
(Without pointer):
1. Find a length of a string.
2. Print string in reverse order.
3. Copy string s into s1 and print it.
4. Accept another string, say s2. Concatenate s and s2 and print
concatenated string.
E04
Given a string s, perform following operations on a string using function
(With pointer):
1. Find a length of a string.
2. Print string in reverse order.
3. Copy string s into s1 and print it.
E05
Given a string s, return true if it a Palindrome or false otherwise.
Test Cases:
Case 1:
Input: MADAM
Output: true
Case 2:
Input: CAR
Output: false
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E06
Accept limit of array from user. As per the limit, read integer elements in
array. Then print :
1. Minimum, Maximum number from array.
2. Search for a particular number from array.
E07
You are given a string s and an integer array index of the same length. The
string s will be shuffled such that the character at the ith position moves
to indices[i] in the shuffled string.
Return the shuffled string.
Test Cases:
Input: s = "codeleet", indices = [4,5,6,7,0,2,1,3]
Output: "leetcode"
Explanation: As shown, "codeleet" becomes "leetcode" after shuffling.
E08
1. Write a Program to print the output like:
A
A B
A B C
A B C D
A B C D E
A B C D
A B C
A B
A
2. Write a program to print factorial of 1 to 10 numbers.
E09
1. Write a Program to print the output like:
1
12
123
12345
E D C B A
E D C B
E D C
E D
E
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E10
Write a C program to find the frequency of each character in a string.
Test Cases: String: This book is very good
Frequency of T:1
Frequency of h:0
Frequency of o:4 and so on for every distinct character.
E11
Write a C program to print Fibonacci series up to n
terms.
E12
Write a C program to count the number of Vowels and
Consonants.
Vowels: 9
Consonants: 14
E13
Write a program to convert decimal to binary
number.
Test Cases:
Input : 5
Output: 101
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E14
Write a C program to reverse an array using
pointers.
E15
Write a function to print all perfect numbers in a
given interval in C programming.
E16
Write a C Program to read and print name and
other details like mobile number, marks of 5
subjects of n number of students using
Structure. Print data of top 5 students ( top 5
should be calculated based on the entered
marks)
E18
Write a C program to store student data(roll no, name,
marks of 5 subjects) in structure. Then calculate the
grade of a student using a logical operator.
(76-99 Distinction
60-75 First Class
50-59 Second Class
40-49 Pass Class
Below 40 Fail)
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E19
Test Cases:
1) input: 671041
output:
Number of digits:6
Addition of digits:19
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E21
E22
E23
Create a structure named Date having day, month
and year as its elements.
Store the current date in the structure. Now add 45
days to the current date and display the final date.
Test Cases:
Input : dd mm yy (e.g 6 /3/23)
Output: dd/mm/yy (20/4/23)
E24
Write a structure to store the roll no., name, age
(between 11 to 14) and address of students (5
students). Store the information of the students.
E25
Write a structure to store the names, salary, and hours
of work per day of 10 employees in a company. Write a
program to increase the salary depending on the number
of hours of work per day as follows and then print the
name of all the employees along with their final
salaries. Assume:
E26
Write a C program to read the first line from a file.
Test Cases: Suppose the program.txt file contains
the following text in the current directory.
Java is Object Oriented Programming.
How are you?
Welcome to VIT
Output: Java is Object Oriented Programming.
E27
Write a C program to create a student database
using file.
Perform following operations:
1. Open file
2. Write five records in file.
3. Read all five records from file.
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E30
Accept number of rows and columns and read elements of matrix.
1. Print matrix in row major format.
2. Print matrix in column major format.
Test Case 1:
Number of rows:2
Number of columns: 3
Matrix Elements: 1 2 3 4 5 6
Row Major:
1 2 3
4 5 6
Column Major
1 3 5
2 4 6
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E31
E34
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E38
1. Write a C program to insert a given number in the array at
given position.
2. Write a C program to remove a number in the array from a
given position.
E39
FY-PSAP LAB EXAM AY:2023-24 SEM-I
E40
Write a C program for swapping of two string
E41
Write a C program for sorting list of elements using bubble sort.
E42
Write a C program for sorting list of elements using selection sort
E43
Write a C program to search element in given list using linear
search . also find largest element in given array.
E44
Write a C program to find duplicate element in an array.
E45
Write a C program to insert element in an array on given specific
position.
FY-PSAP LAB EXAM AY:2023-24 SEM-I
Easy problems
1) length of String
2) palindrome number (hint: reverse and compare with original
one)
3) create a structure with student roll no, name, and cgpa
4) gcd of two numbers
5) reverse string
6) factorial of number
7) table of given number
FY-PSAP LAB EXAM AY:2023-24 SEM-I
Moderate problems
9) linear search
1) find the largest element in an array
2) remove duplicates (both 1&2 you will get on the college wallah
playlist)
3) create file, write in file, read in file
4) frequency of a character in the string
5) reverse num
6) Armstrong number
7) Fibonacci series
8) binary to decimal conversion and vice versa
hard problems
FY-PSAP LAB EXAM AY:2023-24 SEM-I
1) matrix multiplication
2) simple calculator using switch cases
3) Pascal triangle
4) find the second-largest element in the array
5) rotate the array by k elements
6) move all zeros at the end of the array
7) combination of two elements
https://www.geeksforgeeks.org/c-programming-examples/
if you do these problems honestly, you will able to solve any type
of questions given to you