PPS Assignment Problems
PPS Assignment Problems
1. Write a function that will find the sum of as many numbers as the user wants
to.
2. Greatest Common Divisor (GCD): Write a function int gcd(int a, int b)
that checks if a given string str is a palindrome (reads the same backward as
forward).
6. Swap Two Numbers: Write a function void swap(int *x, int *y) that
7. Array Sum with Pointers: Write a function int sum_array(int arr[], int
size) that calculates the sum of elements in an array arr of size size using
pointers.
size) that reverses the elements of an array arr of size size in-place using
pointers.
size) that finds the maximum element in an array arr of size size using
pointers.
12. Extract Words from a String: Write a program that extracts individual words
16. Write a c program to find the position of the first occurrence of a given
character in a string.
18. Date Structure: Define a structure Date to hold day, month, and year. Write
functions to check if a date is valid and calculate the difference between two
dates.
20. Date Structure: Create a structure to represent a date (day, month, year)
and functions to compare two dates, calculate the difference between dates,