C Lab 4-5-6
C Lab 4-5-6
a)
f) k)
b)
g)
l)
c)
h)
m)
d) i)
n)
e)
j) o)
WAP illustrating the concept of jumping (break, continue, and goto) statements in C.
Lab-05 [1D and 2D Array]
1. Write a program to input 10 integers into an array and display them.
2. Write a program to find the sum of all elements in an array of size n.
3. Write a program to find the largest element in an array of size n.
4. Write a program to find the smallest element in an array of size n.
5. Write a program to count the number of even and odd numbers in an array.
6. Write a program to reverse an array of size n and display the reversed array.
7. Write a program to copy the elements of one array into another array.
8. Write a program to delete an element from a specific position in an array.
9. Write a program to sort an array of integers in ascending order.
10. Write a program to sort an array of integers in descending order.
11. Write a program to find the index of a given element in an array.
12. Write a program to find the second largest element in an array.
13. Write a program to remove duplicate elements from an array.
14. Write a program to input and display a 2D array of size m x n.
15. Write a program to find the sum of all elements in a 2D array of size m x n.
16. Write a program to find the largest element in a 2D array of size m x n.
17. Write a program to find the smallest element in a 2D array of size m x n.
18. Write a program to count the number of even and odd numbers in a 2D array.
19. Write a program to find the sum of elements in each row of a 2D array.
20. Write a program to find the sum of elements in each column of a 2D array.
21. Write a program to find the transpose of a 2D array (swap rows and columns).
22. Write a program to add two matrices.
23. Write a program to subtract two matrices.
24. Write a program to add multiply two matrices.
Lab-06 [String]
1. Write C Program to input any five strings and print them.
2. Write C Program to find length of entered string using strlen().
3. Write C Program to read a string with space and reverse that using strrev()
4. Write C Program to read a string and convert that into lower case and upper case. [use
strlwr() and strupr()]
5. Write C Program to copy a string into another using strcpy().
6. Input any two strings and know which has greater ASCII value.[Note: use strcmp()]
7. Write C Program to read a string and concatenate with another string using strcat().
8. Write C Program to know whether a string is palindrome or not.
9. Write C Program to input any ten names of students and arrange them in
descending/ascending order.
10. Write C Program to input any ten strings and search a string in that list.