You are on page 1of 6

Programs on One-Dimensional Arrays

1. Write a program to find mean, median for given array elements.

2. Write a program to delete prime numbers from given array , print the remaining elements of an array

3. Write a program to find minimum and maximum elements in an array

4. Write a program to find second largest and second smallest elements in given array

5. Write a program to find sum and average for a given number of array elements

6. Write a program to insert an element at a given position in an array

7. Write a program to delete an element from a specified position

8. Write a program to merge two arrays

9. Write a program to count number of occurrences of each element in an array

Eg: if array content is : 5 6 7 6 8 7 4 7


5 occurs 1
6 occurs 2
7 occurs 3
8 occurs 1
4 occurs 1
10. Write a program to print all unique elements in an array

Programs on Two-Dimensional Arrays

11. Write a program to find sum of two matrices


12. Write a program to perform matrix multiplication
13. Write a program to check whether a given matrix is symmetric or not
14. Write a program to check whether a given matrix is unit matrix or not
15. Write a program to check whether a given matrix is upper triangular or lower triangular matrix

Programs on Strings
(without string handling functions)
16. Write a program to reverse a string
17. Write a program to copy one string into another string
18. Write a program to compare two string
19. Write a program to check whether a given string is palindrome or not
20. Write a program to sort the alphabets given in a string(dictionary order)
21. Write a program to find the number of spaces, characters, lines, words in a given paragraph
22. Write a program to check whether two strings are anagrams or not
23. Write a program to insert a substring at a specified position in a given string
24. Write a program to find number of occurrences of a given substring in a string
25. Write a program to convert all lower case letters to upper case and vice-versa

(using string handling functions)


26. Write a program to read and print table of strings
27. Write a program to sort table of strings
28. Write a program to check whether a given string is found or not in table of strings
29. Write a program to find the check whether two string are equal or not
30. Write a program to check whether a given string is palindrome or not

Programs on sorting ,Searching and roots finding

31. Write a program to perform linear search


32. Write a program to perform binary search
33. Write a program to perform bubble sort
Programs on One-Dimensional Arrays
34. Write a program to find mean, median for given array elements.

35. Write a program to delete prime numbers from given array , print the remaining elements of an
array

36. Write a program to find minimum and maximum elements in an array

37. Write a program to find second largest and second smallest elements in given array

38. Write a program to find sum and average for a given number of array elements

39. Write a program to insert an element at a given position in an array

40. Write a program to delete an element from a specified position

41. Write a program to merge two arrays

42. Write a program to count number of occurrences of each element in an array

Eg: if array content is : 5 6 7 6 8 7 4 7


5 occurs 1
6 occurs 2
7 occurs 3
8 occurs 1
4 occurs 1
43. Write a program to print all unique elements in an array

Programs on Two-Dimensional Arrays

44. Write a program to find sum of two matrices


45. Write a program to perform matrix multiplication
46. Write a program to check whether a given matrix is symmetric or not
47. Write a program to check whether a given matrix is unit matrix or not
48. Write a program to check whether a given matrix is upper triangular or lower triangular matrix

Programs on Strings
(without string handling functions)
49. Write a program to reverse a string
50. Write a program to copy one string into another string
51. Write a program to compare two string
52. Write a program to check whether a given string is palindrome or not
53. Write a program to sort the alphabets given in a string(dictionary order)
54. Write a program to find the number of spaces, characters, lines, words in a given paragraph
55. Write a program to check whether two strings are anagrams or not
56. Write a program to insert a substring at a specified position in a given string
57. Write a program to find number of occurrences of a given substring in a string
58. Write a program to convert all lower case letters to upper case and vice-versa

(using string handling functions)


59. Write a program to read and print table of strings
60. Write a program to sort table of strings
61. Write a program to check whether a given string is found or not in table of strings
62. Write a program to find the check whether two string are equal or not
63. Write a program to check whether a given string is palindrome or not

Programs on sorting ,Searching and roots finding

64. Write a program to perform linear search


65. Write a program to perform binary search
66. Write a program to perform bubble sort

Programs on Structures:
1. Write a program to read a student data like name, rollno, marks in 6
subjects and calculate the percentage, grade and print all the details
of a student using structures.
2. Implement the above same program to print the details of 5 students
using arrays of structures.
3. Demonstrate the concept of nested structures to print the college and
any 3 department details.
4. Write a program to read and print unions.
5. Write a program to demonstrate various ways of passing structure
to a function
i) Member by member
ii) Structure passing
iii) Structure passing and returning a structure

Programs on Pointers:

1. Find the quotient and remainder of two variables using pointers


and print their respective addresses. (a/b and a%b)
2. Find the maximum difference in an array using pointers.
• By using pointer variable.
• By using array name itself.
3. Search an element in a 1-D array using functions through pointers.
4. Concatenation of two strings using pointers.
5. Compare two strings using pointers.(without string handling
functions) using user defined function
6. Replacing a character in a string with a given character using
pointers.
7. Sort a table of strings using pointers.
8. Read the details of 3 students, find their percentage, average and
allot the grades accordingly using pointers.
(details – name , roll number and marks)
9. Modify a student details by passing desired member of a structure
through pointers and using switch case.
10. Multiplication of two matrices using functions and pointers.
11. Find whether a matrix is symmetric or not? Using array name
itself as pointer.
12. Write a program to demonstrate bitfields.

Programs on Files:
1. Write a program to read a paragraph and store it in a file. Extract
file content to calculate number of words, number of lines ,
number of spaces and number of characters in it.
2. Write a program to store ‘n’ number of integers in a file. Extract
file content and separate even numbers and store in file named
evenfile and odd numbers should be stored in file named oddfile.
3. Write a program to create a text file and replace the word “is” with
“##” in the same file..
4. Write a program to create a text file and replace every 5th character
with “#”
5. Write a program to store 5 student details(Rno, Name, Percentage )
in a file in a tabular form and extract the same from the file(use
fscanf() and fprintf())
6. Write a program to read three integers at run time and find the
greatest of these three numbers(use command line arguments)
7. Write a program to view content of a text file using command line
arguments
8. Write a program to create a text file using command line
arguments
9. Write a program to copy content of one file into another using
command line arguments
10. Create a utility file in which functions to find sum of array
elements, sort of array elements, maximum of array elements,
minimum of array elements will be there. Main program has to
include this file and use the functionalities

You might also like