RAJAGIRI SCHOOL OF ENGINEERING AND TECHNOLOGY (AUTONOMOUS)
101905/CO200G PROGRAMMING IN C
MODEL QUESTIONS FOR LAB EXAMINATION
S2 EE
2025 Even Semester
1. Write a C program to check whether a given year is leap year or not.
2. Read the dimensions of a rectangle, calculate its area and display it using user defined
function.
3. Read 3 integer values and find the largest among them using user defined function.
4. Read a natural number and check whether the number is prime or not.
5. Read a natural number and check whether the number is Armstrong or not.
6. Read n integers, store them in an array and find their sum and average.
7. Read n integers, store them in an array and search for an element in the array using an
algorithm for Linear Search.
8. Read n integers, store them in an array and sort the elements in the array using the Bubble
Sort algorithm.
9. Read a string (word), store it in an array, and check whether it is a palindrome word or not.
10. Read a string, store it in an array, and count the number of vowels in it.
11. Read a string, store it in an array, and count the number of consonants in it.
12. Write a menu-driven program to perform basic calculator functions (addition, subtraction,
multiplication and division).
13. Read two matrices A and B and display their sum.
14. Display the transpose of a given matrix A.
15. Read a matrix and display the sum of its diagonal elements.
16. Find the factorial of first n natural numbers by writing a user-defined function for finding
the factorial.
17. Read a string (word), store it in an array, and obtain its reverse by using a user defined
function.
18. Write a program to find the smallest number in an array.
19. Write a program to find the largest number in an array.
20. Check whether a given number is a perfect number or not.(A perfect number is a positive
integer that is equal to the sum of all its divisors, excluding the number itself. For example, 6
is a perfect number because 1 + 2 + 3 = 6).
21. Write a C Program to Count Number of Uppercase and Lowercase Letters in a given
string. The given string may be a word or a sentence.
22. Write a C program to perform subtraction of two matrices i.e. matrix_C = matrix_A --
matrix_B and display matrix_C. If the given martix are
2 3 5 and 1 5 2 Then the output will be 1 -2 3
456 234 2 22
657 334 3 23
The elements of the output matrix should be separated by one blank space.
23. Write a program display the count of positive and negative numbers are in an array.
24. Write a program to print the elements of an array in reverse order.
25. Write a program to count how many times a given element appears in an array.
26. Write a program to count the number of words in a sentence.