C Pointer and Array Coding Exercises
Beginner Level
--------------
1. Print Array Elements Using Pointers
- Write a program to print elements of an array using pointer arithmetic.
2. Find the Maximum Element
- Use a pointer to traverse the array and find the maximum element.
3. Sum of Array Elements
- Calculate the sum of elements in an array using pointers.
4. Reverse Array
- Write a function that reverses an array using pointer manipulation.
5. Copy One Array to Another
- Use pointers to copy elements from one array to another.
Intermediate Level
------------------
6. Sort an Array Using Pointer Notation
- Implement bubble sort or selection sort using pointers.
7. Find Second Largest Element
- Use pointers to find the second largest element in the array.
8. Count Even and Odd Numbers
- Write a program using pointers to count the number of even and odd integers in
the array.
9. Find Duplicate Elements
- Identify duplicate elements in an array using pointers.
10. Merge Two Arrays
- Merge two arrays into a third using pointers.
Advanced Level
--------------
11. Dynamic Memory Allocation with Arrays
- Use malloc to allocate memory for an array and initialize it using pointers.
12. Matrix Addition/Multiplication Using Pointers
- Implement matrix operations using double pointers.
13. Pointer to Array of Pointers
- Create an array of strings and access each character using pointers.
14. Reallocate Array with realloc
- Write a program that resizes an array using realloc and maintains data
integrity.
15. Implement a Custom memcpy Function
- Write your own version of memcpy using pointer arithmetic.