The document consists of programming assignments divided into two sections, each containing various tasks to be completed. These tasks include writing programs for mathematical computations, string manipulations, and array operations. The assignments aim to enhance programming skills through practical implementation of algorithms and data structures.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
3 views
Index
The document consists of programming assignments divided into two sections, each containing various tasks to be completed. These tasks include writing programs for mathematical computations, string manipulations, and array operations. The assignments aim to enhance programming skills through practical implementation of algorithms and data structures.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
Section -1
S Program Date Page
no. no. 1. WAP to print the sum and product of digits of an integer. 2. WAP to reverse a number.
3. WAP to compute the sum of the first n terms
of the following series S = 1+1/2+1/3+1/4+…… 4. WAP to compute the sum of the first n terms of the following series S =1-2+3-4+5…………. 5. . Write a function that checks whether a given string is Palindrome or not. Use this function to find whether the string entered by user is Palindrome or not. 6. Write a function to find whether a given no. is prime or not. Use the same to generate the prime numbers less than 100. 7. WAP to compute the factors of a given number. 8. Write a macro that swaps two numbers. WAP to use it. 9. WAP to print a triangle of stars as follows (take number of lines from user): * *** ***** ******* 10. 10. WAP to perform following actions on an array entered by the user: i. Print the even-valued elements ii. Print the odd-valued elements iii. Calculate and print the sum and average of the elements of array iv. Print the maximum and minimum element of array v. Remove the duplicates from the array vi. Print the array in reverse order S no. Section-2 Program Date Page no. 1. 1. WAP to perform following actions on an array entered by the user: a. Print the even-valued elements b. Print the odd-valued elements c. Calculate and print the sum and average of the elements of array d. Print the maximum and minimum element of array e. Remove the duplicates from the array f. Print the array in reverse order 2. WAP that prints a table indicating the number of occurrences of each alphabet in the text entered as command line arguments. 3. Write a program that swaps two numbers using pointers. 4. Write a program in which a function is passed address of two variables and then alter its contents. 5. Write a program which takes the radius of a circle as input from the user, passes it to another function that computes the area and the circumference of the circle and displays the value of area and circumference from the main() function. 6. Write a program to find sum of n elements entered by the user. To write this program, allocate memory dynamically using malloc() / calloc() functions or new operator. 7. Write a menu driven program to perform following operations on strings: 8. Given two ordered arrays of integers, write a program to merge the two-arrays to get an ordered array. 9. WAP to display Fibonacci series (i)using recursion, (ii) using iteration 10 WAP to calculate Factorial of a number (i)using recursion, (ii) using iteration 11. WAP to calculate GCD of two numbers (i) with recursion (ii) without recursion.