Lab 6
1. Create and initialize an array of size 5 and display it.
2. Find the sum of all elements in a user defined array
3. Create an N size array for integer and floating type and display each of the
elements.
Prepared by: Pragati Shahi
Lab 6
4. Reverse the elements of an array.
5. Write a program to display the percentage from marks of 5 subjects obtained by
a student.
6. Find the smallest element from an array.
Prepared by: Pragati Shahi
Lab 6
7. Find the largest element from an array.
8. Write an algorithm, flowchart and source code for selection sorting in
descending order in a user defined array.
9. Perform selection sorting in ascending order in a user defined array.
10. Write an algorithm, flowchart and source code for bubble sorting in ascending
order in a user defined array.
Prepared by: Pragati Shahi
Lab 6
11. Perform sequential search in a user defined array.
12. Create, initialize and display a 2x2 square matrix.
13. Create and display an NxN square matrix also check whether the dimension of
matrix is square or not.
Prepared by: Pragati Shahi
Lab 6
14. Add two 2x2 matrix and display the result using a third matrix.
15. Write a program to transpose a MxN matrix.
16. Perform a matrix multiplication between a MxN and PxQ matrix and display
the result.
Prepared by: Pragati Shahi
Lab 6
17. Write a program to display a string using formatted input and output function.
18. Write a program to display a string using unformatted input and output
function.
Prepared by: Pragati Shahi
Lab 6
19. Programmatically display the problem of overflow using string.
20. Programmatically solve the overflow in string.
21. Write a program that takes character until a lower case in encountered.
22. Write a program to display the length of your full name using strlen().
23. Write a program to display the length of your full name without using strlen().
24. Write a program to copy to another array of characters using strcpy().
Prepared by: Pragati Shahi
Lab 6
25. Write a program to copy to another array of characters without using strcpy().
26. Perform string concatenation.
27. Check whether two strings are same or not using library function.
28. Perform reversal of a string using a library function.
29. Check whether a string is palindrome or not.
Prepared by: Pragati Shahi
Lab 6
30. Write a program to display the following patterns:
a.)
N
NE
NEP
NEPA
NEPAL
b.)
NEPAL
NEPA
NEP
NE
N
Prepared by: Pragati Shahi
Lab 6
c.)
N
EP
PAL
d.)
N
NEP
NEPAL
Prepared by: Pragati Shahi