Without using any built-in string handling functions, write a menu-driven C program to perform the
following operations on a given string:
1. Reverse the string.
2. Count the number of words.
3. Convert the string to uppercase.
4. Check whether the string is an anagram of another string.
5. Display the frequency of vowels and consonants.
Use the switch-case construct for implementing the menu.
- Solved Assignments
- Study Notes
- Guess Papers
- Question Papers
✓ Unlock up to 60% of the answer
✓ No payment required
Write a C program that accepts n integer values from the user and performs the following operations
using one-dimensional arrays:
Find the second largest and second smallest elements.
Count the number of even and odd numbers.
Display all duplicate elements, if any.
Compute the average of all elements.
Explain the concept of dynamic memory allocation in C. Write a C program that dynamically allocates
memory to store the details of N products (Product ID, Product Name, Quantity, Price).
The program should:
Accept product details.
Display all products.
Find the costliest product.
Calculate the total inventory value.
Release the allocated memory before termination.
Discuss the advantages of dynamic memory allocation in this context.
Explain the role of structures and nested structures in C programming. Define appropriate structures for a
Library Management System containing:
Book ID
Title
Author
Publisher
Number of Copies
Write functions to:
Input book details.
Display all records.
Search a book using Book ID.
Display books written by a specified author.
Without using any built-in string handling functions, write a menu-driven C program to perform the
following operations on a given string:
1. Reverse the string.
2. Count the number of words.
3. Convert the string to uppercase.
4. Check whether the string is an anagram of another string.
5. Display the frequency of vowels and consonants.
Use the switch-case construct for implementing the menu.
Explain the concepts of recursion and iteration in C with suitable examples. Write two separate C
programs to calculate the Greatest Common Divisor (GCD) of two positive integers:
using an iterative approach and
using a recursive approach
Compare both approaches
Write a C program to perform operations on a square matrix of order N.
The program should:
Find the sum of each row and each column.
Compute the sum of the principal and secondary diagonals.
Check whether the matrix is symmetric.
Display the transpose of the matrix.