0% found this document useful (0 votes)
7 views10 pages

Lab 6

Lab 6 consists of various programming tasks focused on arrays, matrices, and string manipulation. Key activities include creating and initializing arrays, performing sorting and searching algorithms, and manipulating strings with functions like strcpy() and strlen(). The document is structured with tasks prepared by Pragati Shahi, emphasizing practical programming skills.

Uploaded by

dahalkrishala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views10 pages

Lab 6

Lab 6 consists of various programming tasks focused on arrays, matrices, and string manipulation. Key activities include creating and initializing arrays, performing sorting and searching algorithms, and manipulating strings with functions like strcpy() and strlen(). The document is structured with tasks prepared by Pragati Shahi, emphasizing practical programming skills.

Uploaded by

dahalkrishala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

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

You might also like