Exercises
https://classroom.github.com/a/sBjTVbsl
Sum of Array Elements Using Pointers
Write a C program that calculates the sum of an array using pointers.
Input: Array (e.g., {1, 2, 3})
Output: Sum (e.g., 6)
Multiplication Table
Write a C program that prints the multiplication table of a given number using a for loop.
Input: A number (e.g., 5)
Output: Multiplication table (e.g., 5 x 1 = 5, ..., 5 x 10 = 50)
Count Digits in a Number
Write a C program that counts the number of digits in a given integer using a while loop.
Input: An integer (e.g., 987654)
Output: Number of digits (e.g., 6)
Merge Two Sorted Arrays
Write a C program that merges two sorted arrays into a single sorted array.
Input: Two sorted arrays (e.g., {1, 3, 5} and {2, 4, 6})
Output: Merged sorted array (e.g., {1, 2, 3, 4, 5, 6})
Frequency of Elements in an Array
Write a C program that finds the frequency of each element in an array.
Input: An array (e.g., {1, 2, 1, 3, 2, 2})
Output: Frequency of each element (e.g., 1 appears 2 times, 2 appears 3 times, 3 appears 1 time)
Reverse a String Using Pointers
Write a C program that reverses a string using pointers.
Input: A string (e.g., "Hello")
Output: Reversed string (e.g., "olleH")
Sort an array of elements by only using pointers.