Problems on array_string_function_structure
Problems on array_string_function_structure
String
1. C program to count the number of words and number of characters in a given line of text
except the spaces.
2. C program to count the numbers of vowels, consonants, digits and special symbols in a
given string.
3. C program to input a multi word string and produce a string in which first letter of each
word is capitalized.
4. C program to search a character in a given string.
5. C program to reverse a string.
6. C program to read a string and print the length of each word.
7. C program to evaluate string functions. [strcpy(), strcat(), strcmp() and strlen()]
Function
1. Write a function that takes one integer argument and returns its square.
2. Write a function to calculate the area of various geometrical (circle, square, rectangle,
triangle, etc.).
3. Write a function that has one-character argument and displays that it’s a small letter,
capital letter, a digit or a special symbol.
4. Write a function that will check whether a number is prime or not.
5. Write a program to take two numbers as input and function to swap them by passing
parameters as values and also as addresses.
6. Write a recursive function that will find the factorial of an integer.
7. Write a recursive function that will find the GCD of two numbers.
8. Write a function that will find the minimum and maximum number from an array.
9. Write a function that receives a string (character array) as argument and returns the length
of this array.
10. Write a function that will sort an unsorted array.
Structure
1. Write a program to store and display information of multiple students. Each student has
attributes: name, roll_number, and marks.
2. Write a program to calculate the distance between two points in a 2D space. Each point
has x and y coordinates.
3. Write a program to store information of multiple books (title, author, price) and display
books that have a price above a specified value.
4. Write a program to store information about employees and calculate total salary paid by a
company. Each employee has an id, name, and salary.
5. Write a program to input information about students and calculate the grade of each
student based on their marks.