0% found this document useful (0 votes)
4 views1 page

C Programs for Arrays and Strings

The document outlines a series of programming assignments focused on arrays and strings in C. Tasks include finding the largest and smallest elements in an array, reversing an array, counting positive and negative elements, sorting, searching, merging, and manipulating strings. Additional exercises involve string operations such as checking for palindromes, counting characters, and using recursion.

Uploaded by

farwasabhir
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)
4 views1 page

C Programs for Arrays and Strings

The document outlines a series of programming assignments focused on arrays and strings in C. Tasks include finding the largest and smallest elements in an array, reversing an array, counting positive and negative elements, sorting, searching, merging, and manipulating strings. Additional exercises involve string operations such as checking for palindromes, counting characters, and using recursion.

Uploaded by

farwasabhir
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

Assignment: Array and String

1. Write a C program to find the largest and smallest element in an array.


2. Write a program to reverse an array without using another array.
3. Given an array, count how many elements are positive, negative, and zero.
4. Write a program to sort an array using bubble sort.
5. Input N numbers and find their sum and average.
6. Write a program to search an element in an array using linear search.
7. Write a function to merge two arrays into a third array.
8. Write a program to shift array elements one position to the right (cyclic shift).
9. Write a C program to find the second-largest number in an array.
10. Given an array, remove all duplicate elements and print the updated array.
11. Write a C program to find the length of a string without using strlen().
12. Convert a string to upper case without using strupr().
13. Count the number of vowels, consonants, digits, and special characters in a string.
14. Reverse a string using a loop.
15. Check whether a string is a palindrome.
16. Compare two strings without using strcmp().
17. Remove all spaces from a given string.
18. Write a program to count the frequency of each character in a string.
19. Write a recursive function to calculate the power of a number.
20. Write a recursive function to print numbers from N to 1.

You might also like